Simplify recieve frame logic.
This commit is contained in:
parent
8b6c5d138f
commit
6e0cf0e802
1 changed files with 2 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue