Commit 2a672652 authored by Michael Niedermayer's avatar Michael Niedermayer

mlp_parser: dont override existing channel geometry.

This prevents race conditions
And partly fixes Ticket1726
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d25f87f5
...@@ -317,6 +317,7 @@ static int mlp_parse(AVCodecParserContext *s, ...@@ -317,6 +317,7 @@ static int mlp_parse(AVCodecParserContext *s,
avctx->sample_rate = mh.group1_samplerate; avctx->sample_rate = mh.group1_samplerate;
s->duration = mh.access_unit_size; s->duration = mh.access_unit_size;
if(!avctx->channels || !avctx->channel_layout) {
if (mh.stream_type == 0xbb) { if (mh.stream_type == 0xbb) {
/* MLP stream */ /* MLP stream */
avctx->channels = mlp_channels[mh.channels_mlp]; avctx->channels = mlp_channels[mh.channels_mlp];
...@@ -331,6 +332,7 @@ static int mlp_parse(AVCodecParserContext *s, ...@@ -331,6 +332,7 @@ static int mlp_parse(AVCodecParserContext *s,
avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1); avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1);
} }
} }
}
if (!mh.is_vbr) /* Stream is CBR */ if (!mh.is_vbr) /* Stream is CBR */
avctx->bit_rate = mh.peak_bitrate; avctx->bit_rate = mh.peak_bitrate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment