]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mlp_parser.c
mlp_parser: dont override existing channel geometry.
[ffmpeg] / libavcodec / mlp_parser.c
index 7c0630caac9620f5c58568e2c410db04ab33e25e..5fb1424b468cc02895a58213854412f18e8870a9 100644 (file)
@@ -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;