From 6d166987a0cce4e56faa888c4bbb7929e7866faf Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Thu, 7 Feb 2008 21:17:36 +0000 Subject: Return GST_FLOW_NOT_NEGOTIATED if we get a buffer without caps, and add a somewhat useful debug message. Plus test. Original commit message from CVS: * gst/icydemux/gsticydemux.c: (gst_icydemux_chain): * tests/check/elements/icydemux.c: Return GST_FLOW_NOT_NEGOTIATED if we get a buffer without caps, and add a somewhat useful debug message. Plus test. --- gst/icydemux/gsticydemux.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gst/icydemux') diff --git a/gst/icydemux/gsticydemux.c b/gst/icydemux/gsticydemux.c index d99b29f9..3dc47d42 100644 --- a/gst/icydemux/gsticydemux.c +++ b/gst/icydemux/gsticydemux.c @@ -497,8 +497,9 @@ gst_icydemux_chain (GstPad * pad, GstBuffer * buf) GstFlowReturn ret = GST_FLOW_OK; icydemux = GST_ICYDEMUX (GST_PAD_PARENT (pad)); - g_return_val_if_fail (GST_IS_ICYDEMUX (icydemux), GST_FLOW_ERROR); - g_return_val_if_fail (icydemux->meta_interval >= 0, GST_FLOW_ERROR); + + if (G_UNLIKELY (icydemux->meta_interval < 0)) + goto not_negotiated; if (icydemux->meta_interval == 0) { ret = gst_icydemux_typefind_or_forward (icydemux, buf); @@ -558,6 +559,15 @@ done: gst_buffer_unref (buf); return ret; + +/* ERRORS */ +not_negotiated: + { + GST_WARNING_OBJECT (icydemux, "meta_interval not set, buffer probably had " + "no caps set. Try enabling iradio-mode on the http source element"); + gst_buffer_unref (buf); + return GST_FLOW_NOT_NEGOTIATED; + } } static GstStateChangeReturn -- cgit