From 0a31b030641601cd7f65a7d9194816b91b260075 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 3 Apr 2020 22:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84MP4=E7=82=B9=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/MP4Reader.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Record/MP4Reader.cpp b/src/Record/MP4Reader.cpp index e9a7b3eb..aaf32079 100644 --- a/src/Record/MP4Reader.cpp +++ b/src/Record/MP4Reader.cpp @@ -136,13 +136,12 @@ bool MP4Reader::seekTo(uint32_t ui32Stamp){ return true; } //搜索到下一帧关键帧 - bool eof = false; bool keyFrame = false; - while (!eof) { + while (true) { auto frame = _demuxer->readFrame(keyFrame); if(!frame){ - eof = true; - break; + //文件读完了都未找到下一帧关键帧 + return false; } if(keyFrame || frame->keyFrame() || frame->configFrame()){ //定位到key帧