diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-04 19:49:35 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-04 19:49:35 +0300 |
commit | 0e1b7765be878491565cf5e471f22b15e106164c (patch) | |
tree | 422e500c289335182a2a64934dcabf10b95e32dc /libmpcodecs/ad_ffmpeg.c | |
parent | a9618c1c6fe9424dfaeb1677348e0382d7252554 (diff) | |
parent | dcfd043ea8d0c46929aad78596314d837c290d39 (diff) | |
download | mpv-0e1b7765be878491565cf5e471f22b15e106164c.tar.bz2 mpv-0e1b7765be878491565cf5e471f22b15e106164c.tar.xz |
Merge svn changes up to r29644
Diffstat (limited to 'libmpcodecs/ad_ffmpeg.c')
-rw-r--r-- | libmpcodecs/ad_ffmpeg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 9829e57975..bf3da1cbbe 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -36,6 +36,7 @@ static int preinit(sh_audio_t *sh) static int init(sh_audio_t *sh_audio) { + int tries = 0; int x; AVCodecContext *lavc_context; AVCodec *lavc_codec; @@ -106,7 +107,9 @@ static int init(sh_audio_t *sh_audio) } // Decode at least 1 byte: (to get header filled) - x=decode_audio(sh_audio,sh_audio->a_buffer,1,sh_audio->a_buffer_size); + do { + x=decode_audio(sh_audio,sh_audio->a_buffer,1,sh_audio->a_buffer_size); + } while (x <= 0 && tries++ < 5); if(x>0) sh_audio->a_buffer_len=x; sh_audio->channels=lavc_context->channels; |