整理MediaSource派生类

修复转协议或录制时忽然Track的问题
This commit is contained in:
xiongziliang
2019-12-26 11:53:19 +08:00
parent 806747a9d5
commit 3830792c57
15 changed files with 172 additions and 150 deletions

View File

@@ -89,6 +89,7 @@ void RtspDemuxer::makeAudioTrack(const SdpTrack::Ptr &audio) {
if(_audioRtpDecoder){
//设置rtp解码器代理生成的frame写入该Track
_audioRtpDecoder->addDelegate(_audioTrack);
onAddTrack(_audioTrack);
} else{
//找不到相应的rtp解码器该track无效
_audioTrack.reset();
@@ -105,6 +106,7 @@ void RtspDemuxer::makeVideoTrack(const SdpTrack::Ptr &video) {
if(_videoRtpDecoder){
//设置rtp解码器代理生成的frame写入该Track
_videoRtpDecoder->addDelegate(_videoTrack);
onAddTrack(_videoTrack);
}else{
//找不到相应的rtp解码器该track无效
_videoTrack.reset();