Commit 3172b312 authored by Aman Gupta's avatar Aman Gupta

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: 's avatarAman Gupta <aman@tmm1.net>
Signed-off-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
parent f56ee740
...@@ -452,7 +452,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) ...@@ -452,7 +452,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
/* skip fetching new packet if we still have one buffered */ /* skip fetching new packet if we still have one buffered */
if (s->buffered_pkt.size > 0) if (s->buffered_pkt.size > 0)
return AVERROR(EAGAIN); return mediacodec_send_receive(avctx, s, frame, true);
/* fetch new packet or eof */ /* fetch new packet or eof */
ret = ff_decode_get_packet(avctx, &s->buffered_pkt); ret = ff_decode_get_packet(avctx, &s->buffered_pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment