[FFmpeg-cvslog] r20430 - trunk/libavcodec/flacdec.c

jbr subversion
Sun Nov 1 17:48:05 CET 2009


Author: jbr
Date: Sun Nov  1 17:48:05 2009
New Revision: 20430

Log:
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.

Modified:
   trunk/libavcodec/flacdec.c

Modified: trunk/libavcodec/flacdec.c
==============================================================================
--- trunk/libavcodec/flacdec.c	Sun Nov  1 16:08:49 2009	(r20429)
+++ trunk/libavcodec/flacdec.c	Sun Nov  1 17:48:05 2009	(r20430)
@@ -125,6 +125,10 @@ static av_cold int flac_decode_init(AVCo
 
     /* 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 @@ void ff_flac_parse_streaminfo(AVCodecCon
     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);



More information about the ffmpeg-cvslog mailing list