ffplay: fix invalid wanted_channel_layout calculation
authorMarton Balint <cus@passwd.hu>
Wed, 4 Jan 2012 21:50:09 +0000 (22:50 +0100)
committerMarton Balint <cus@passwd.hu>
Thu, 5 Jan 2012 19:04:23 +0000 (20:04 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index 46426e7..1a1b3f7 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2263,7 +2263,7 @@ static int stream_component_open(VideoState *is, int stream_index)
         if (env)
             wanted_channel_layout = av_get_default_channel_layout(SDL_atoi(env));
         if (!wanted_channel_layout) {
-            wanted_channel_layout = (avctx->channel_layout && avctx->channels == av_get_channel_layout_nb_channels(avctx->channels)) ? avctx->channel_layout : av_get_default_channel_layout(avctx->channels);
+            wanted_channel_layout = (avctx->channel_layout && avctx->channels == av_get_channel_layout_nb_channels(avctx->channel_layout)) ? avctx->channel_layout : av_get_default_channel_layout(avctx->channels);
             wanted_channel_layout &= ~AV_CH_LAYOUT_STEREO_DOWNMIX;
             wanted_nb_channels = av_get_channel_layout_nb_channels(wanted_channel_layout);
             /* SDL only supports 1, 2, 4 or 6 channels at the moment, so we have to make sure not to request anything else. */