diff options
author | wm4 <wm4@nowhere> | 2013-11-26 01:49:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-26 01:49:17 +0100 |
commit | 8846a2f95c274aeccdf9755dffa69b2a40a942e5 (patch) | |
tree | 3013afaca25577bafc1c4efa2fd9b74d0d3cf59b | |
parent | bdd00d8b65b7cc6ec9c2084aeb56c98b81787f81 (diff) | |
download | mpv-8846a2f95c274aeccdf9755dffa69b2a40a942e5.tar.bz2 mpv-8846a2f95c274aeccdf9755dffa69b2a40a942e5.tar.xz |
ad_lavc: increase number of packets for initial decode
Apparently just 5 packets is not enough for the initial audio decode
(which is needed to find the format). The old code (before the recent
refactor) appeared to use 5 packets, but there were apparently other
code paths which in the end amounted to more than 5 packets being read.
The sample that failed (see github issue #368) needed 9 packets.
Fixes #368.
-rw-r--r-- | audio/decode/ad_lavc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 35ebce07cc..0f442cef52 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -263,9 +263,12 @@ static int init(struct dec_audio *da, const char *decoder) // Decode at least 1 sample: (to get header filled) for (int tries = 1; ; tries++) { int x = decode_new_packet(da); - if (x >= 0 && ctx->frame.samples > 0) + if (x >= 0 && ctx->frame.samples > 0) { + mp_msg(MSGT_DECAUDIO, MSGL_V, + "Initial decode succeeded after %d packets.\n", tries); break; - if (tries >= 5) { + } + if (tries >= 50) { mp_msg(MSGT_DECAUDIO, MSGL_ERR, "ad_lavc: initial decode failed\n"); uninit(da); |