mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 09:47:33 +08:00
优化解复用器/播放器逻辑,在Track准备就绪后回调播放结果
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user