mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
gst/audioconvert/gstaudioconvert.c: Passthrough the channel positions if the number of output channels is the same as...
Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate_channels): Passthrough the channel positions if the number of output channels is the same as the number of input channels, the input had a channel layout and downstream requests no special one. We did this already for > 2 channels but now it's also done for 1 channel. Fixes bug #533617.
This commit is contained in:
parent
d8dc371c0d
commit
d76c4b4c65
2 changed files with 15 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2008-05-20 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
* gst/audioconvert/gstaudioconvert.c:
|
||||||
|
(gst_audio_convert_fixate_channels):
|
||||||
|
Passthrough the channel positions if the number of output channels is
|
||||||
|
the same as the number of input channels, the input had a channel
|
||||||
|
layout and downstream requests no special one. We did this already for
|
||||||
|
> 2 channels but now it's also done for 1 channel. Fixes bug #533617.
|
||||||
|
|
||||||
2008-05-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-05-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init),
|
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init),
|
||||||
|
|
|
@ -819,7 +819,7 @@ static void
|
||||||
gst_audio_convert_fixate_channels (GstBaseTransform * base, GstStructure * ins,
|
gst_audio_convert_fixate_channels (GstBaseTransform * base, GstStructure * ins,
|
||||||
GstStructure * outs)
|
GstStructure * outs)
|
||||||
{
|
{
|
||||||
const GValue *out_layout;
|
const GValue *in_layout, *out_layout;
|
||||||
gint in_chans, out_chans;
|
gint in_chans, out_chans;
|
||||||
|
|
||||||
if (!gst_structure_get_int (ins, "channels", &in_chans))
|
if (!gst_structure_get_int (ins, "channels", &in_chans))
|
||||||
|
@ -844,19 +844,18 @@ gst_audio_convert_fixate_channels (GstBaseTransform * base, GstStructure * ins,
|
||||||
/* check if the output has a channel layout (or a list of layouts) */
|
/* check if the output has a channel layout (or a list of layouts) */
|
||||||
out_layout = gst_structure_get_value (outs, "channel-positions");
|
out_layout = gst_structure_get_value (outs, "channel-positions");
|
||||||
|
|
||||||
|
/* get the channel layout of the input if any */
|
||||||
|
in_layout = gst_structure_get_value (ins, "channel-positions");
|
||||||
|
|
||||||
if (out_layout == NULL) {
|
if (out_layout == NULL) {
|
||||||
if (out_chans <= 2)
|
if (out_chans <= 2 && in_chans != out_chans && in_layout == NULL)
|
||||||
return; /* nothing to do, default layout will be assumed */
|
return; /* nothing to do, default layout will be assumed */
|
||||||
GST_WARNING_OBJECT (base, "downstream caps contain no channel layout");
|
GST_WARNING_OBJECT (base, "downstream caps contain no channel layout");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_chans == out_chans) {
|
if (in_chans == out_chans && in_layout != NULL) {
|
||||||
const GValue *in_layout;
|
|
||||||
GValue res = { 0, };
|
GValue res = { 0, };
|
||||||
|
|
||||||
in_layout = gst_structure_get_value (ins, "channel-positions");
|
|
||||||
g_return_if_fail (in_layout != NULL);
|
|
||||||
|
|
||||||
/* same number of channels and no output layout: just use input layout */
|
/* same number of channels and no output layout: just use input layout */
|
||||||
if (out_layout == NULL) {
|
if (out_layout == NULL) {
|
||||||
gst_structure_set_value (outs, "channel-positions", in_layout);
|
gst_structure_set_value (outs, "channel-positions", in_layout);
|
||||||
|
|
Loading…
Reference in a new issue