From 500ad376575ea99ff9ac15620bfcef8887b3a6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 29 Sep 2011 21:50:59 +0100 Subject: [PATCH] vorbisdec: set channel positions --- ext/vorbis/gstvorbisdec.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c index d4225e881b..62be606a3f 100644 --- a/ext/vorbis/gstvorbisdec.c +++ b/ext/vorbis/gstvorbisdec.c @@ -505,7 +505,6 @@ vorbis_handle_identification_packet (GstVorbisDec * vd) { GstCaps *caps; GstAudioInfo info; - const GstAudioChannelPosition *pos = NULL; gst_audio_info_set_format (&info, GST_VORBIS_AUDIO_FORMAT, vd->vi.rate, vd->vi.channels); @@ -520,17 +519,23 @@ vorbis_handle_identification_packet (GstVorbisDec * vd) case 5: case 6: case 7: - case 8: + case 8:{ + const GstAudioChannelPosition *pos; + gint i; + pos = gst_vorbis_channel_positions[info.channels - 1]; + for (i = 0; i < info.channels; i++) + info.position[i] = pos[i]; break; - default: - { + } + default:{ gint i, max_pos = MAX (info.channels, 64); GST_ELEMENT_WARNING (vd, STREAM, DECODE, (NULL), ("Using NONE channel layout for more than 8 channels")); for (i = 0; i < max_pos; i++) info.position[i] = GST_AUDIO_CHANNEL_POSITION_NONE; + break; } }