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.
This commit is contained in:
wm4 2013-12-04 23:30:01 +01:00
parent e9f49ea84d
commit 2bcfb49a39
1 changed files with 3 additions and 3 deletions

View File

@ -353,10 +353,10 @@ static int decode_new_packet(struct dec_audio *da)
talloc_free(mpkt); talloc_free(mpkt);
priv->packet = NULL; 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) { if (ret < 0) {
mp_msg(MSGT_DECAUDIO, MSGL_V, "lavc_audio: error\n"); mp_msg(MSGT_DECAUDIO, MSGL_V, "lavc_audio: error\n");
return -1; return -1;