From 97dd32f748962d5ee3e402e8ed7b6f8f99756f8c Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 7 Jan 2005 18:17:52 +0000 Subject: [PATCH] gst/audioconvert/gstaudioconvert.c: The return value of fixate_to does not imply that the requested value was set, so... Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate): The return value of fixate_to does not imply that the requested value was set, so don't assume. --- ChangeLog | 6 ++++++ gst/audioconvert/gstaudioconvert.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 593d491..7735685 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-07 Ronald S. Bultje + + * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate): + The return value of fixate_to does not imply that the requested + value was set, so don't assume. + 2005-01-07 Gergely Nagy Reviewed by: Ronald S. Bultje diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 1ec9925..bcb898e 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -523,9 +523,10 @@ gst_audio_convert_fixate (GstPad * pad, const GstCaps * caps) } if (_fixate_caps_to_int (©, "channels", try.channels)) { - int n; + int n, c; - if (try.channels > 2) { + gst_structure_get_int (gst_caps_get_structure (copy, 0), "channels", &c); + if (c > 2) { /* make sure we have a channelpositions structure or array here */ GstStructure *str; @@ -533,7 +534,7 @@ gst_audio_convert_fixate (GstPad * pad, const GstCaps * caps) str = gst_caps_get_structure (copy, n); if (!gst_structure_get_value (str, "channel-positions")) { /* first try otherpad's positions, else anything */ - if (ac_caps.pos != NULL) { + if (ac_caps.pos != NULL && c == ac_caps.channels) { gst_audio_set_channel_positions (str, ac_caps.pos); } else { gst_audio_set_structure_channel_positions_list (str, -- 2.7.4