aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-03-13 02:40:09 -0700
committerAman Gupta <aman@tmm1.net>2018-03-13 12:32:08 -0700
commit3172b31223e1f0a64233fa5b355e11d7a00e477b (patch)
treeba2ba274ecfbb13e30fad626a7903995cdaa221a
parentf56ee7403384a7aae0f5ee5aa76da0dedfdd7c35 (diff)
downloadffmpeg-3172b31223e1f0a64233fa5b355e11d7a00e477b.tar.gz
avcodec/mediacodecdec: fix immediate EAGAIN with buffered packet
In cases where the mediacodec decoder consumed a partial packet, receive_frame() would start returning EAGAIN if the rest of the packet couldn't be flushed and no frames were immediately available. This fixes receive_frame() to perform its normal blocking wait for new frames before returning EAGAIN. Fixes an issue I could reproduce fairly often on a FireOS 6 device, and reported to be happening intermittently by two mpv users. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
-rw-r--r--libavcodec/mediacodecdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 89d2421ae9..0d4a853f07 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -452,7 +452,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
/* skip fetching new packet if we still have one buffered */
if (s->buffered_pkt.size > 0)
- return AVERROR(EAGAIN);
+ return mediacodec_send_receive(avctx, s, frame, true);
/* fetch new packet or eof */
ret = ff_decode_get_packet(avctx, &s->buffered_pkt);