完善MP4点播

This commit is contained in:
xiongziliang 2020-04-03 22:08:03 +08:00
parent 47d8e37e3d
commit 0a31b03064

View File

@ -136,13 +136,12 @@ bool MP4Reader::seekTo(uint32_t ui32Stamp){
return true; return true;
} }
//搜索到下一帧关键帧 //搜索到下一帧关键帧
bool eof = false;
bool keyFrame = false; bool keyFrame = false;
while (!eof) { while (true) {
auto frame = _demuxer->readFrame(keyFrame); auto frame = _demuxer->readFrame(keyFrame);
if(!frame){ if(!frame){
eof = true; //文件读完了都未找到下一帧关键帧
break; return false;
} }
if(keyFrame || frame->keyFrame() || frame->configFrame()){ if(keyFrame || frame->keyFrame() || frame->configFrame()){
//定位到key帧 //定位到key帧