summaryrefslogtreecommitdiffstats
path: root/gst/icydemux
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2008-02-07 21:17:36 +0000
committerTim-Philipp Müller <tim@centricular.net>2008-02-07 21:17:36 +0000
commit6d166987a0cce4e56faa888c4bbb7929e7866faf (patch)
tree757df6d8cc0da2ddfb2e3052fa77acb3d76afda6 /gst/icydemux
parentf0690e19ea6753d7b360a8bc26350d2ec44a13ba (diff)
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.
Diffstat (limited to 'gst/icydemux')
-rw-r--r--gst/icydemux/gsticydemux.c14
1 files changed, 12 insertions, 2 deletions
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