[FFmpeg-cvslog] flacdec: do not overwrite a channel layout set by the caller
Anton Khirnov
git at videolan.org
Wed May 28 12:20:23 CEST 2014
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun May 25 11:12:33 2014 +0200| [f13ffb6636fdecb5e3e0ddcff48f096e7b3db362] | committer: Anton Khirnov
flacdec: do not overwrite a channel layout set by the caller
The channel layout mask for non-standard layouts is typically stored at
the container level (as a vorbiscomment tag) for FLAC.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f13ffb6636fdecb5e3e0ddcff48f096e7b3db362
---
libavcodec/flac.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index b3e3847..e6a8ab8 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -225,7 +225,10 @@ void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *
avctx->channels = s->channels;
avctx->sample_rate = s->samplerate;
avctx->bits_per_raw_sample = s->bps;
- ff_flac_set_channel_layout(avctx);
+
+ if (!avctx->channel_layout ||
+ av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels)
+ ff_flac_set_channel_layout(avctx);
s->samples = get_bits_long(&gb, 32) << 4;
s->samples |= get_bits(&gb, 4);
More information about the ffmpeg-cvslog
mailing list