[FFmpeg-devel] [PATCH] let the ffpcm set sample_fmt for wav audio streams

Michael Niedermayer michaelni
Thu Nov 26 18:12:17 CET 2009


On Thu, Nov 26, 2009 at 05:43:28PM +0530, Jai Menon wrote:
> Hi,
> 
> All the 24bit PCM WAV files I have show the wrong sample_fmt. Would it
> be okay if we let the decoder set correct sample_fmt instead of the
> default s16. Attached patch is more or less what I mean. Please tell
> me if I'm missing something, or if there is a better way to show
> correct stream info.
> Thanks.
> 
> -- 
> Jai Menon

>  riff.c |    2 ++
>  1 file changed, 2 insertions(+)
> f6e0cd818e7c167c93fe9e4baec767455af2bac3  sample_fmt_wav.patch
> Index: libavformat/riff.c
> ===================================================================
> --- libavformat/riff.c	(revision 20584)
> +++ libavformat/riff.c	(working copy)
> @@ -450,6 +450,8 @@
>      codec->sample_rate = get_le32(pb);
>      codec->bit_rate = get_le32(pb) * 8;
>      codec->block_align = get_le16(pb);
> +    codec->sample_fmt = SAMPLE_FMT_NONE;

you want to change
s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE
in avcodec_get_context_defaults2()
i suspect ...
dunno if that can just done or if it will need more changes but adding
=NONE hacks in lavf is not a good idea

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20091126/7548049f/attachment.pgp>



More information about the ffmpeg-devel mailing list