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.
This commit is contained in:
David Schleef 2004-01-12 18:59:57 +00:00
parent 10b53458ad
commit 61763a83f0
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2004-01-12 David Schleef <ds@schleef.org>
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_link):
Test that pad is negotiated before getting its caps.
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_get_sink_element): When

View file

@ -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;