Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-22 16:25:53 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-12-22 16:25:53 +0400
commit98256622a66ebda8f07bb725419c35bb8aa7e01b (patch)
tree76f39fe2fbf9c91a5fbb8a55251e36ebf55121a8
parent3f72dbe4620716113754d06b7ffd558e56d1585f (diff)
parentaef5150719f03ce87e67c17d2006e24d8961aa17 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: flac: only set channel layout if not previously set or on channel count change prepare 9_beta3 release Conflicts: RELEASE Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/flac_parser.c7
-rw-r--r--libavcodec/flacdec.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c
index 7d3c5c4973..52ec1ee683 100644
--- a/libavcodec/flac_parser.c
+++ b/libavcodec/flac_parser.c
@@ -457,9 +457,12 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
check_header_mismatch(fpc, header, child, 0);
}
+ if (header->fi.channels != fpc->avctx->channels ||
+ (!fpc->avctx->channel_layout && header->fi.channels <= 6)) {
+ fpc->avctx->channels = header->fi.channels;
+ ff_flac_set_channel_layout(fpc->avctx);
+ }
fpc->avctx->sample_rate = header->fi.samplerate;
- fpc->avctx->channels = header->fi.channels;
- ff_flac_set_channel_layout(fpc->avctx);
fpc->pc->duration = header->fi.blocksize;
*poutbuf = flac_fifo_read_wrap(fpc, header->offset, *poutbuf_size,
&fpc->wrap_buf,
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index d555ddfc2e..9d5ecd04cf 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -424,7 +424,8 @@ static int decode_frame(FLACContext *s)
return ret;
}
s->channels = s->avctx->channels = fi.channels;
- ff_flac_set_channel_layout(s->avctx);
+ if (!s->avctx->channel_layout && s->channels <= 6)
+ ff_flac_set_channel_layout(s->avctx);
s->ch_mode = fi.ch_mode;
if (!s->bps && !fi.bps) {