From 61763a83f0d34bd0e093fdf3b27aa1c9bfb814ee Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 12 Jan 2004 18:59:57 +0000 Subject: [PATCH] gst/audioconvert/gstaudioconvert.c: Test that pad is negotiated before getting its caps. Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_link): Test that pad is negotiated before getting its caps. --- ChangeLog | 5 +++++ gst/audioconvert/gstaudioconvert.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63d900d..58fe746 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-12 David Schleef + + * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_link): + Test that pad is negotiated before getting its caps. + 2004-01-12 Julien MOUTTE * gst-libs/gst/play/gstplay.c: (gst_play_get_sink_element): When diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 7461f64..c2e6801 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -406,14 +406,16 @@ gst_audio_convert_link (GstPad *pad, const GstCaps *caps) GstPadLinkReturn ret; otherpad = (nr) ? this->src : this->sink; - othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); + if (gst_pad_is_negotiated (otherpad)) { + othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); - gst_caps_set_simple (othercaps, "rate", G_TYPE_INT, rate, NULL); + gst_caps_set_simple (othercaps, "rate", G_TYPE_INT, rate, NULL); - ret = gst_pad_try_set_caps (otherpad, othercaps); - if (GST_PAD_LINK_FAILED (ret)) return ret; + ret = gst_pad_try_set_caps (otherpad, othercaps); + if (GST_PAD_LINK_FAILED (ret)) return ret; - this->rate[1 - nr] = rate; + this->rate[1 - nr] = rate; + } } this->caps_set[nr] = TRUE; -- 2.7.4