summaryrefslogtreecommitdiff
path: root/libavcodec/mlp_parser.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-25 22:35:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-25 22:35:26 +0200
commit2a672652bb70fe6ae1c711f80678f9a513732ee1 (patch)
treedd64fb927adbccf980ca1013fe80fd95878e5450 /libavcodec/mlp_parser.c
parentd25f87f5174df5923be7ce0bb89fad08999286ed (diff)
mlp_parser: dont override existing channel geometry.
This prevents race conditions And partly fixes Ticket1726 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mlp_parser.c')
-rw-r--r--libavcodec/mlp_parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 7c0630caac..5fb1424b46 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -317,6 +317,7 @@ static int mlp_parse(AVCodecParserContext *s,
avctx->sample_rate = mh.group1_samplerate;
s->duration = mh.access_unit_size;
+ if(!avctx->channels || !avctx->channel_layout) {
if (mh.stream_type == 0xbb) {
/* MLP stream */
avctx->channels = mlp_channels[mh.channels_mlp];
@@ -331,6 +332,7 @@ static int mlp_parse(AVCodecParserContext *s,
avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1);
}
}
+ }
if (!mh.is_vbr) /* Stream is CBR */
avctx->bit_rate = mh.peak_bitrate;