diff --git a/src/video/bikreader.cpp b/src/video/bikreader.cpp index a7563af3..c7bcab64 100644 --- a/src/video/bikreader.cpp +++ b/src/video/bikreader.cpp @@ -246,21 +246,12 @@ private: } if (packet.stream_index != _videoStreamIdx) continue; - bool gotFrame = false; - int retVal = avcodec_receive_frame(_videoCodecCtx, _frame); - if (retVal == 0) { - gotFrame = true; - } - if (retVal == AVERROR(EAGAIN)) { - retVal = 0; - } - if (retVal == 0) { + if (retVal == 0 || retVal == AVERROR(EAGAIN)) { avcodec_send_packet(_videoCodecCtx, &packet); + if (retVal == AVERROR(EAGAIN)) continue; } - if (gotFrame == false) continue; - --count; if (ignore) continue;