Do not fail on EAGAIN
A call to avcodec_receive_frame() may return AVERROR(EAGAIN) if more input is required. This is not an error, do not fail.
This commit is contained in:
parent
633b18d786
commit
82b4acee73
1 changed files with 5 additions and 3 deletions
|
@ -100,12 +100,14 @@ static int run_decoder(void *data) {
|
||||||
LOGE("Could not send video packet: %d", ret);
|
LOGE("Could not send video packet: %d", ret);
|
||||||
goto run_quit;
|
goto run_quit;
|
||||||
}
|
}
|
||||||
if ((ret = avcodec_receive_frame(codec_ctx, decoder->frames->decoding_frame)) < 0) {
|
ret = avcodec_receive_frame(codec_ctx, decoder->frames->decoding_frame);
|
||||||
|
if (!ret) {
|
||||||
|
// a frame was received
|
||||||
|
push_frame(decoder);
|
||||||
|
} else if (ret != AVERROR(EAGAIN)) {
|
||||||
LOGE("Could not receive video frame: %d", ret);
|
LOGE("Could not receive video frame: %d", ret);
|
||||||
goto run_quit;
|
goto run_quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
push_frame(decoder);
|
|
||||||
#else
|
#else
|
||||||
while (packet.size > 0) {
|
while (packet.size > 0) {
|
||||||
int got_picture;
|
int got_picture;
|
||||||
|
|
Loading…
Reference in a new issue