修复断连续推转协议失效的bug

This commit is contained in:
ziyue
2022-01-10 17:34:25 +08:00
parent 1dabc22347
commit 412d280cd7
4 changed files with 27 additions and 12 deletions

View File

@@ -131,6 +131,9 @@ void RtmpDemuxer::inputRtmp(const RtmpPacket::Ptr &pkt) {
}
void RtmpDemuxer::makeVideoTrack(const AMFValue &videoCodec, int bit_rate) {
if (_video_rtmp_decoder) {
return;
}
//生成Track对象
_video_track = dynamic_pointer_cast<VideoTrack>(Factory::getVideoTrackByAmf(videoCodec));
if (!_video_track) {
@@ -151,6 +154,9 @@ void RtmpDemuxer::makeVideoTrack(const AMFValue &videoCodec, int bit_rate) {
}
void RtmpDemuxer::makeAudioTrack(const AMFValue &audioCodec,int sample_rate, int channels, int sample_bit, int bit_rate) {
if (_audio_rtmp_decoder) {
return;
}
//生成Track对象
_audio_track = dynamic_pointer_cast<AudioTrack>(Factory::getAudioTrackByAmf(audioCodec, sample_rate, channels, sample_bit));
if (!_audio_track) {