add warning if getcaps function returns an unreferenced caps

Original commit message from CVS:
add warning if getcaps function returns an unreferenced caps
This commit is contained in:
David Schleef 2003-07-13 19:15:30 +00:00
parent 803229d42f
commit 88282d4f05

View file

@ -1833,8 +1833,13 @@ gst_pad_get_caps (GstPad *pad)
return GST_PAD_CAPS (realpad);
}
else if GST_RPAD_GETCAPSFUNC (realpad) {
GstCaps *caps;
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function");
return GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL);
caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL);
if(caps)g_return_val_if_fail(caps->refcount > 0, NULL);
return caps;
}
else if (GST_PAD_PAD_TEMPLATE (realpad)) {
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad);