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

Justin Ruggles justin.ruggles
Sun Nov 8 02:23:22 CET 2009


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.

-Justin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default_sample_fmt.patch
Type: text/x-diff
Size: 494 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091107/9ac0f8dd/attachment.patch>



More information about the ffmpeg-devel mailing list