avcodec/mediacodecdec: fix immediate EAGAIN with buffered packet
authorAman Gupta <aman@tmm1.net>
Tue, 13 Mar 2018 09:40:09 +0000 (02:40 -0700)
committerAman Gupta <aman@tmm1.net>
Tue, 13 Mar 2018 19:32:08 +0000 (12:32 -0700)
commit3172b31223e1f0a64233fa5b355e11d7a00e477b
treeba2ba274ecfbb13e30fad626a7903995cdaa221a
parentf56ee7403384a7aae0f5ee5aa76da0dedfdd7c35
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>
libavcodec/mediacodecdec.c