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>2013-01-23 19:34:34 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-01-23 19:34:52 +0400
commit86b892af199d420fe2bcf5f8fb96c377d924ad43 (patch)
treee68c8748e7146c4b5ffc103fc37c4f1f6197ff22 /libavcodec/mlp_parser.c
parent1cf6f6f3daa9d9ae54a4bf0267b510e1638e272b (diff)
parentb0c7e3ffd09f68022429920da483ad7abed84aa1 (diff)
Merge commit 'b0c7e3ffd09f68022429920da483ad7abed84aa1'
* commit 'b0c7e3ffd09f68022429920da483ad7abed84aa1': mlp_parser: account for AVCodecContext.request_channels when setting the channel layout. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mlp_parser.c')
-rw-r--r--libavcodec/mlp_parser.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 2497ac3612..5393b6f01b 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -328,11 +328,23 @@ static int mlp_parse(AVCodecParserContext *s,
if(!avctx->channels || !avctx->channel_layout) {
if (mh.stream_type == 0xbb) {
/* MLP stream */
- avctx->channels = mh.channels_mlp;
- avctx->channel_layout = mh.channel_layout_mlp;
+ if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
+ mh.num_substreams > 1) {
+ avctx->channels = 2;
+ avctx->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ avctx->channels = mh.channels_mlp;
+ avctx->channel_layout = mh.channel_layout_mlp;
+ }
} else { /* mh.stream_type == 0xba */
/* TrueHD stream */
- if (mh.channels_thd_stream2) {
+ if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
+ mh.num_substreams > 1) {
+ avctx->channels = 2;
+ avctx->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else if (mh.channels_thd_stream2 &&
+ (avctx->request_channels <= 0 ||
+ avctx->request_channels > mh.channels_thd_stream1)) {
avctx->channels = mh.channels_thd_stream2;
avctx->channel_layout = mh.channel_layout_thd_stream2;
} else {