From 2bcfb49a390a928c535cba7cab2b4136f27fceca Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Dec 2013 23:30:01 +0100 Subject: ad_lavc: handle decoder EAGAIN only if there was an input packet Otherwise, it'd probably get stuck if the decoder still returns EAGAIN at EOF on e.g. a shortened data stream. --- audio/decode/ad_lavc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 8837f681eb..1ff8769cd7 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -353,10 +353,10 @@ static int decode_new_packet(struct dec_audio *da) talloc_free(mpkt); priv->packet = NULL; } + // LATM may need many packets to find mux info + if (ret == AVERROR(EAGAIN)) + return 0; } - // LATM may need many packets to find mux info - if (ret == AVERROR(EAGAIN)) - return 0; if (ret < 0) { mp_msg(MSGT_DECAUDIO, MSGL_V, "lavc_audio: error\n"); return -1; -- cgit v1.2.3