diff options
author | Jonathan Matthew <jonathan@d14n.org> | 2009-09-06 23:09:21 +1000 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-09-08 15:29:24 +0200 |
commit | 595de04316bcfc5526cc09b347685473b279325b (patch) | |
tree | 95c20bbe1db768ad95d2555908c664782924923d | |
parent | 2af8b4dd1526dc393e67e88d595cf2ec58eb6d96 (diff) |
codecmap: don't set channel-positions for common mono and stereo cases
-rw-r--r-- | ext/ffmpeg/gstffmpegcodecmap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 7907388..5e3aebb 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; } |