Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2019-04-24 10:59:28 +0300
committerMatthieu Bouron <matthieu.bouron@gmail.com>2019-06-13 12:41:18 +0300
commitd83985ce11d0f68d293e52fdccfc62fe9d28d54f (patch)
treec7520e1db5856d6296a916f8c901e46a3a148610 /libavcodec/mediacodecdec.c
parentcaabe1b4956d054bc3b077ae03a0d4205dbb843e (diff)
avcodec/mediacodecdec: try to receive a frame after signaling EOF to the codec
Avoids returning EAGAIN after signaling EOF to the codec in ff_mediacodec_dec_send() so we can try to receive a frame before returning in mediacodec_receive_frame(). This helps avoiding an extra round-trip between avcodec_send_frame() and avcodec_receive_frame() while draining the remaining frames.
Diffstat (limited to 'libavcodec/mediacodecdec.c')
-rw-r--r--libavcodec/mediacodecdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 3a4240aa95..e353e34bd5 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -461,6 +461,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
ret = ff_mediacodec_dec_send(avctx, s->ctx, &null_pkt, true);
if (ret < 0)
return ret;
+ return ff_mediacodec_dec_receive(avctx, s->ctx, frame, true);
} else if (ret == AVERROR(EAGAIN) && s->ctx->current_input_buffer < 0) {
return ff_mediacodec_dec_receive(avctx, s->ctx, frame, true);
} else if (ret < 0) {