ad_ffmpeg: switch to avcodec_decode_audio4()
commitdeffd15a056f98bbe1bc34ce87dea0b4a530d61d
authorUoti Urpala <uau@mplayer2.org>
Wed, 18 Apr 2012 22:26:56 +0000 (19 01:26 +0300)
committerUoti Urpala <uau@mplayer2.org>
Wed, 18 Apr 2012 22:42:30 +0000 (19 01:42 +0300)
tree1fa363205a2ff7b147bbfd956ace50824642a48e
parentb9fefc87c01bbf464fb74981313efa77e03735f6
ad_ffmpeg: switch to avcodec_decode_audio4()

Switch libavcodec audio decoding from avcodec_decode_audio3() to
avcodec_decode_audio4(). Instead of decoding directly to the output
buffer, the data is now copied from the libavcodec output packet,
adding an extra memory copy (optimizing this would require some
interface changes).

After libavcodec added avcodec_decode_audio4() earlier, it dropped
support for splitting large audio packets into output chunks of size
AVCODEC_MAX_AUDIO_FRAME_SIZE or less. This caused a regression with
the previous API: audio files with huge packets could fail to decode,
as libavcodec refused to write into the AVCODEC_MAX_AUDIO_FRAME_SIZE
buffer provided by mplayer2. This occurrend mainly with some lossless
audio formats. This commit restores support for those files; there are
now no fixed limits on packet size.
libmpcodecs/ad_ffmpeg.c