[FFmpeg-devel] [PATCH] change default sample_fmt to SAMPLE_FMT_NONE

Baptiste Coudurier baptiste.coudurier
Sun Nov 8 04:47:21 CET 2009


On 11/7/09 6:35 PM, Michael Niedermayer wrote:
> On Sat, Nov 07, 2009 at 08:23:22PM -0500, Justin Ruggles wrote:
>> Patch attached to change the default sample_fmt from SAMPLE_FMT_S16 to
>> SAMPLE_FMT_NONE.
>>
>> With the patch, av_find_stream_info() will work how it is supposed to
>> with regard to sample_fmt.  has_codec_parameters() requires sample_fmt
>> to be set.  Currently the requirement is pointless because it is already
>> set by default, and that default value may or may not be correct.
>>
>> example console output from ffmpeg with 24-bit FLAC file:
>>
>> current SVN: Stream #0.0: Audio: flac, 192000 Hz, 2 channels, s16
>> with patch:  Stream #0.0: Audio: flac, 192000 Hz, 2 channels, s32
>>
>> One side effect of this patch is that av_find_stream_info() will fail
>> when the probe size is larger than the file size and the decoder for the
>> stream type is disabled or non-existant.
>>
>> example when FLAC decoder is disabled:
>>
>> file size=2901817, -probesize 2000000:
>> current SVN: Stream #0.0: Audio: 0x0000, 192000 Hz, 2 channels, s16
>> with patch:  Stream #0.0: Audio: 0x0000, 192000 Hz, 2 channels
>>
>> file size=2901817, -probesize 3000000:
>> current SVN: Stream #0.0: Audio: 0x0000, 192000 Hz, 2 channels, s16
>> with patch:  Could not find codec parameters (Audio: 0x0000, 192000 Hz,
>> 2 channels)
>>
>>
>> If it is truly desired behavior for ffmpeg to fail when it cannot find
>> all codec parameters, one of those being sample_fmt, then this is
>> correct behavior.  Otherwise, we need to reevaluate whether we want
>> sample_fmt to be one of those required parameters.
>
> only require sample_fmt when a decoder is available

I think the same applies to video codecs.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list