优化解复用器/播放器逻辑,在Track准备就绪后回调播放结果

This commit is contained in:
xiongziliang
2018-11-15 15:14:05 +08:00
parent be81aa7fbb
commit 132468e997
9 changed files with 106 additions and 116 deletions

View File

@@ -112,38 +112,5 @@ void RtmpDemuxer::makeAudioTrack(const AMFValue &audioCodec) {
}
}
vector<Track::Ptr> RtmpDemuxer::getTracks() const {
vector<Track::Ptr> ret;
if(_videoTrack){
ret.emplace_back(_videoTrack);
}
if(_audioTrack){
ret.emplace_back(_audioTrack);
}
return ret;
}
bool RtmpDemuxer::isInited() const {
bool videoReady ,auidoReady;
if(_videoTrack){
videoReady = _videoTrack->ready();
}else{
videoReady = _tryedGetVideoTrack || _tryedGetAudioTrack;
}
if(_audioTrack){
auidoReady = _audioTrack->ready();
}else{
auidoReady = _tryedGetVideoTrack || _tryedGetAudioTrack;
}
return videoReady && auidoReady;
}
float RtmpDemuxer::getDuration() const {
return _fDuration;
}
} /* namespace mediakit */