diff --git a/ChangeLog b/ChangeLog index e2de9385db..671b701f3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-20 Sebastian Dröge + + * 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 * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init), diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 82f03dcaac..970be60028 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -819,7 +819,7 @@ static void gst_audio_convert_fixate_channels (GstBaseTransform * base, GstStructure * ins, GstStructure * outs) { - const GValue *out_layout; + const GValue *in_layout, *out_layout; gint in_chans, out_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) */ 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_chans <= 2) + if (out_chans <= 2 && in_chans != out_chans && in_layout == NULL) return; /* nothing to do, default layout will be assumed */ GST_WARNING_OBJECT (base, "downstream caps contain no channel layout"); } - if (in_chans == out_chans) { - const GValue *in_layout; + if (in_chans == out_chans && in_layout != NULL) { 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 */ if (out_layout == NULL) { gst_structure_set_value (outs, "channel-positions", in_layout);