From 68c6ddc2fc9cfd9c32470d4b465c05b3b04abebe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Jan 2010 08:19:55 +0100 Subject: [PATCH] vorbis: Add official 6.1 and 7.1 channel mappings These are in the Vorbis spec since 2010-01-13. Fixes bug #606926. --- ext/vorbis/vorbisdec.c | 21 +++++++++------------ ext/vorbis/vorbisenc.c | 22 ++++++++++------------ 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index ce4bb934f6..4249993c55 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -606,19 +606,16 @@ vorbis_handle_identification_packet (GstVorbisDec * vd) pos = pos6; break; } - /* FIXME: for >6 channels the layout is not defined by the Vorbis - * spec. These are the gstreamer "defaults" for 7/8 channels and - * NONE layouts for more channels - */ + /* 6.1 and 7.1 are in the Vorbis spec since 2010-01-13 */ case 7:{ static const GstAudioChannelPosition pos7[] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, - GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, - GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, - GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, - GST_AUDIO_CHANNEL_POSITION_LFE, + GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, + GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, + GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER, + GST_AUDIO_CHANNEL_POSITION_LFE }; pos = pos7; /* fallthrough */ @@ -626,13 +623,13 @@ vorbis_handle_identification_packet (GstVorbisDec * vd) case 8:{ static const GstAudioChannelPosition pos8[] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, - GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, - GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, - GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, - GST_AUDIO_CHANNEL_POSITION_LFE, + GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, + GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, + GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, + GST_AUDIO_CHANNEL_POSITION_LFE }; pos = pos8; diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index da9da157ea..4ad643c116 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -259,25 +259,23 @@ static const GstAudioChannelPosition vorbischannelpositions[][8] = { GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, GST_AUDIO_CHANNEL_POSITION_LFE, }, - { /* Not defined by spec, GStreamer default */ + { /* 6.1 Surround, in Vorbis spec since 2010-01-13 */ GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, - GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, - GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, - GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, - GST_AUDIO_CHANNEL_POSITION_LFE, + GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, + GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, + GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER, - }, - { /* Not defined by spec, GStreamer default */ + GST_AUDIO_CHANNEL_POSITION_LFE}, + { /* 7.1 Surround, in Vorbis spec since 2010-01-13 */ GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, - GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, - GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, - GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, - GST_AUDIO_CHANNEL_POSITION_LFE, + GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, - }, + GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, + GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, + GST_AUDIO_CHANNEL_POSITION_LFE}, }; static GstCaps * -- 2.34.1