gst/udp/gstudpsrc.c: Check for unfixed caps and throw an element error. (bug #136334)

Original commit message from CVS:
* gst/udp/gstudpsrc.c: (gst_udpsrc_get):  Check for unfixed
caps and throw an element error.  (bug #136334)
This commit is contained in:
David Schleef 2004-03-06 01:01:28 +00:00
parent 9331801a62
commit 740ad5455d
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2004-03-05 David Schleef <ds@schleef.org>
* gst/udp/gstudpsrc.c: (gst_udpsrc_get): Check for unfixed
caps and throw an element error. (bug #136334)
2004-03-05 David Schleef <ds@schleef.org>
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_srcgetcaps),

View file

@ -234,9 +234,17 @@ gst_udpsrc_get (GstPad *pad)
buf[ret] = '\0';
doc = xmlParseMemory(buf, ret);
caps = gst_caps_load_thyself(doc->xmlRootNode);
if (caps == NULL) {
return NULL;
}
/* foward the connect, we don't signal back the result here... */
gst_pad_try_set_caps (udpsrc->srcpad, caps);
if (gst_caps_is_fixed (caps)) {
gst_pad_try_set_caps (udpsrc->srcpad, caps);
} else {
GST_ERROR ("caps %" GST_PTR_FORMAT, caps);
GST_ELEMENT_ERROR (udpsrc, CORE, NEGOTIATION, (NULL), ("Got unfixed caps from peer"));
}
#endif
g_free (buf);