完善判断解复用器是否准备好的机制

This commit is contained in:
xiongziliang
2018-10-24 22:29:19 +08:00
parent 3921bfb2d9
commit 5ae154642c
4 changed files with 56 additions and 38 deletions

View File

@@ -135,16 +135,17 @@ vector<Track::Ptr> RtspDemuxer::getTracks() const {
}
bool RtspDemuxer::isInited() const {
bool ret = true;
if(ret && _audioTrack){
//getTrackType() 等于TrackInvalid时说明该Track还未准备好
ret = _audioTrack->getTrackType() != TrackInvalid;
}
if(ret && _videoTrack){
//getTrackType() 等于TrackInvalid时说明该Track还未准备好
ret = _videoTrack->getTrackType() != TrackInvalid;
}
return ret;
bool videoReady = true ,auidoReady = true;
if(_videoTrack){
videoReady = _videoTrack->ready();
}
if(_audioTrack){
auidoReady = _audioTrack->ready();
}
return videoReady && auidoReady;
}
float RtspDemuxer::getDuration() const {