mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
vorbisdec: set channel positions
This commit is contained in:
parent
4b43972cf4
commit
500ad37657
1 changed files with 9 additions and 4 deletions
|
@ -505,7 +505,6 @@ vorbis_handle_identification_packet (GstVorbisDec * vd)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstAudioInfo info;
|
GstAudioInfo info;
|
||||||
const GstAudioChannelPosition *pos = NULL;
|
|
||||||
|
|
||||||
gst_audio_info_set_format (&info, GST_VORBIS_AUDIO_FORMAT, vd->vi.rate,
|
gst_audio_info_set_format (&info, GST_VORBIS_AUDIO_FORMAT, vd->vi.rate,
|
||||||
vd->vi.channels);
|
vd->vi.channels);
|
||||||
|
@ -520,17 +519,23 @@ vorbis_handle_identification_packet (GstVorbisDec * vd)
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
case 7:
|
case 7:
|
||||||
case 8:
|
case 8:{
|
||||||
|
const GstAudioChannelPosition *pos;
|
||||||
|
gint i;
|
||||||
|
|
||||||
pos = gst_vorbis_channel_positions[info.channels - 1];
|
pos = gst_vorbis_channel_positions[info.channels - 1];
|
||||||
|
for (i = 0; i < info.channels; i++)
|
||||||
|
info.position[i] = pos[i];
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
{
|
default:{
|
||||||
gint i, max_pos = MAX (info.channels, 64);
|
gint i, max_pos = MAX (info.channels, 64);
|
||||||
|
|
||||||
GST_ELEMENT_WARNING (vd, STREAM, DECODE,
|
GST_ELEMENT_WARNING (vd, STREAM, DECODE,
|
||||||
(NULL), ("Using NONE channel layout for more than 8 channels"));
|
(NULL), ("Using NONE channel layout for more than 8 channels"));
|
||||||
for (i = 0; i < max_pos; i++)
|
for (i = 0; i < max_pos; i++)
|
||||||
info.position[i] = GST_AUDIO_CHANNEL_POSITION_NONE;
|
info.position[i] = GST_AUDIO_CHANNEL_POSITION_NONE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue