GNOME Bugzilla – Bug 731286
avauddec: Ensure input buffers have FF_INPUT_BUFFER_PADDING_SIZE padding
Last modified: 2015-08-16 13:41:25 UTC
The audio decoder is not using the base class to do allocation. This results in not operating an allocation query, which isn't ideal. What need to be done, from my point of view, is move the code from gst_ffmpegauddec_negotiate() to be an override of GstAudioDecoder::negotiate, and then call gst_audio_decoder_negotiate() instead. Doing this will ensure pending events are sent (avoid miss-ordering), will handle if caps didn't change, will run device_allocation() hence use the downstream allocator if any. It will also allow implement decided_allocation in a way that we can update the allocation params witch required alignement (15). (If audio sink do have buffer pool, note that the base class does not use that at the moment.)
Created attachment 277975 [details] [review] Patch to fix input buffer padding This patch adds input buffer padding (just like in gstavviddec.c), which is required by avcodec_decode_audio4(). However, the propose_allocation function doesn't get called, due to this bug.
Comment on attachment 277975 [details] [review] Patch to fix input buffer padding Looks good to me, but maybe we should refactor the code from here and the video decoder into a common function instead of duplicating it
Comment on attachment 277975 [details] [review] Patch to fix input buffer padding Does not apply to git master anymore. Can you update it? Also the decide_allocation() bit is irrelevant now as we don't implement get_buffer() or get_buffer2() anymore.
Ok, I did it now ;) commit 30a4a28793f2e0ff08aaea368b7c14317ac2ca21 Author: Thomas Bluemel <tbluemel@control4.com> Date: Tue Jun 30 19:18:53 2015 +0200 avauddec: Ensure input buffers have FF_INPUT_BUFFER_PADDING_SIZE padding, which is required by avcodec_decode_audio4 ()