ad_ffmpeg: return failure from init() if initial decode fails
commit0321d683b4b970fd1025f8613c6a0ce9fcc98716
authorUoti Urpala <uau@mplayer2.org>
Tue, 3 May 2011 13:52:57 +0000 (3 16:52 +0300)
committerUoti Urpala <uau@mplayer2.org>
Tue, 3 May 2011 13:52:57 +0000 (3 16:52 +0300)
treeb11901084ca9f8d5e1167a966b34ecb474af3064
parent78dca643015fb5ff23e68bd5032a55cafba8b31f
ad_ffmpeg: return failure from init() if initial decode fails

The init() method in ad_ffmpeg tries to decode some audio data after
opening the libavcodec decoder; however the method returned success
even if this part failed. Change it to return failure instead,
indicating that the codec could not be successfully opened.

This improves behavior at least with some AAC files, for which the
libavcodec decoder can be successfully initialized but decoding
packets always fails. Before the audio would be decoded with
libavcodec, producing only a constant stream of errors; after this
commit audio decoder initialization falls back to FAAD (if available)
which works for these samples.
libmpcodecs/ad_ffmpeg.c