From 595de04316bcfc5526cc09b347685473b279325b Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Sun, 6 Sep 2009 23:09:21 +1000 Subject: [PATCH] codecmap: don't set channel-positions for common mono and stereo cases --- ext/ffmpeg/gstffmpegcodecmap.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 7907388d86..5e3aebbdd5 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -160,8 +160,16 @@ gst_ff_channel_layout_to_gst (guint64 channel_layout, guint channels) } } - if (nchannels == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER) - pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_MONO; + if (nchannels == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER) { + GST_DEBUG ("mono common case; won't set channel positions"); + g_free (pos); + pos = NULL; + } else if (nchannels == 2 && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT + && pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT) { + GST_DEBUG ("stereo common case; won't set channel positions"); + g_free (pos); + pos = NULL; + } return pos; }