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

Michael Niedermayer michaelni
Sun Nov 8 03:35:47 CET 2009


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

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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/20091108/8f617c66/attachment.pgp>



More information about the ffmpeg-devel mailing list