mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2025-02-17 13:29:56 +08:00
修复rtmp解复用器可能丢失config帧的bug
This commit is contained in:
parent
db261260ff
commit
0808cdee4b
@ -52,27 +52,27 @@ int RtmpDemuxer::getTrackCount(const AMFValue &metedata) {
|
|||||||
bool RtmpDemuxer::inputRtmp(const RtmpPacket::Ptr &pkt) {
|
bool RtmpDemuxer::inputRtmp(const RtmpPacket::Ptr &pkt) {
|
||||||
switch (pkt->typeId) {
|
switch (pkt->typeId) {
|
||||||
case MSG_VIDEO: {
|
case MSG_VIDEO: {
|
||||||
if(_videoRtmpDecoder){
|
|
||||||
return _videoRtmpDecoder->inputRtmp(pkt, true);
|
|
||||||
}
|
|
||||||
if(!_tryedGetVideoTrack){
|
if(!_tryedGetVideoTrack){
|
||||||
_tryedGetVideoTrack = true;
|
_tryedGetVideoTrack = true;
|
||||||
auto codec = AMFValue(pkt->getMediaType());
|
auto codec = AMFValue(pkt->getMediaType());
|
||||||
makeVideoTrack(codec);
|
makeVideoTrack(codec);
|
||||||
}
|
}
|
||||||
|
if(_videoRtmpDecoder){
|
||||||
|
return _videoRtmpDecoder->inputRtmp(pkt, true);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MSG_AUDIO: {
|
case MSG_AUDIO: {
|
||||||
if(_audioRtmpDecoder){
|
|
||||||
_audioRtmpDecoder->inputRtmp(pkt, false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(!_tryedGetAudioTrack) {
|
if(!_tryedGetAudioTrack) {
|
||||||
_tryedGetAudioTrack = true;
|
_tryedGetAudioTrack = true;
|
||||||
auto codec = AMFValue(pkt->getMediaType());
|
auto codec = AMFValue(pkt->getMediaType());
|
||||||
makeAudioTrack(codec);
|
makeAudioTrack(codec);
|
||||||
}
|
}
|
||||||
|
if(_audioRtmpDecoder){
|
||||||
|
_audioRtmpDecoder->inputRtmp(pkt, false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user