aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2009-11-01 16:48:05 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2009-11-01 16:48:05 +0000
commit4c1645a4589d79501abbbba6a94247d4e6c724ad (patch)
treecdb7ac69ad1e5ee4989b4ffddd163fb06b716737
parentdee34af4d6eec7cfb2f96e81d6b7f5719a04a866 (diff)
downloadffmpeg-4c1645a4589d79501abbbba6a94247d4e6c724ad.tar.gz
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. Originally committed as revision 20430 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/flacdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 781b4fadf1..0ebc23d6cf 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -125,6 +125,10 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
/* 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(AVCodecContext *avctx, struct FLACStreaminfo *s,
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);