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

Michael Niedermayer michaelni
Mon Nov 9 00:19:28 CET 2009


On Sat, Nov 07, 2009 at 07:47:21PM -0800, Baptiste Coudurier wrote:
> 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.

yes

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091109/508c0c12/attachment.pgp>



More information about the ffmpeg-devel mailing list