From: Burkhard P. <bur...@ig...> - 2013-10-08 09:36:31
|
Hi, Am 07.10.2013 21:48, schrieb Erik Johansson: > Hi, [...] >> AVCodecContext provides a field for audio sample format as follows: >> /** >> * audio sample format >> * - encoding: Set by user. >> * - decoding: Set by libavcodec. >> */ >> enum AVSampleFormat sample_fmt; ///< sample format >> The audio decoder in libquicktimes ffmpeg plugin sets sample_fmt to 16bit signed, and >> then relies on that being the case throughout the code. Only the latest ffmpeg resets >> sample_fmt to float as per the documentation. This was written at a time when all ffmpeg audio codecs used 16 bit samples. Nowadays it's different. The behaviour of the core is to call the decode() function with output = NULL at the beginning. During this initialization call, the member atrack->sample_format can be set (according to what's in ffmpeg). In most codecs it's hardwired, but in audiocodec/pcm.c you'll find a function init_decode_lpcm(), which does runtime detection of the sample format. Making proper sample format detection and supporting planar audio in ffmpeg would be a very patch to start with. Burkhard |