[FFmpeg-cvslog] Make a plausibility check when setting channel layout for TrueHD.
Carl Eugen Hoyos
git at videolan.org
Sat Apr 2 00:51:33 CEST 2011
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Apr 2 00:48:43 2011 +0200| [2a0bd2bfc957abe3fab97cc27e6d997099082841] | committer: Carl Eugen Hoyos
Make a plausibility check when setting channel layout for TrueHD.
TrueHD supports more channels than FFmpeg, so a valid sample
could set the channel layout to a value that represents less
channels than the sample actually consists of.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a0bd2bfc957abe3fab97cc27e6d997099082841
---
libavcodec/mlp_parser.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 90b0d00..38b80e0 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -325,6 +325,10 @@ static int mlp_parse(AVCodecParserContext *s,
avctx->channels = truehd_channels(mh.channels_thd_stream1);
avctx->channel_layout = truehd_layout(mh.channels_thd_stream1);
}
+ if (av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels) {
+ avctx->channel_layout = 0;
+ av_log_ask_for_sample(avctx, "Unknown channel layout.");
+ }
}
if (!mh.is_vbr) /* Stream is CBR */
More information about the ffmpeg-cvslog
mailing list