changeset 10485:87b01c645235 libavcodec

Set sample format in flac_decode_init() rather than in ff_flac_parse_streaminfo() since the latter is shared with the raw FLAC demuxer, which should not be setting the sample format.
author jbr
date Sun, 01 Nov 2009 16:48:05 +0000
parents ccad7a2ff75f
children b2524430a456
files flacdec.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flacdec.c	Sun Nov 01 15:08:49 2009 +0000
+++ b/flacdec.c	Sun Nov 01 16:48:05 2009 +0000
@@ -125,6 +125,10 @@
 
     /* initialize based on the demuxer-supplied streamdata header */
     ff_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
+    if (s->bps > 16)
+        avctx->sample_fmt = SAMPLE_FMT_S32;
+    else
+        avctx->sample_fmt = SAMPLE_FMT_S16;
     allocate_buffers(s);
     s->got_streaminfo = 1;
 
@@ -186,10 +190,6 @@
     avctx->channels = s->channels;
     avctx->sample_rate = s->samplerate;
     avctx->bits_per_raw_sample = s->bps;
-    if (s->bps > 16)
-        avctx->sample_fmt = SAMPLE_FMT_S32;
-    else
-        avctx->sample_fmt = SAMPLE_FMT_S16;
 
     s->samples  = get_bits_long(&gb, 32) << 4;
     s->samples |= get_bits(&gb, 4);