summaryrefslogtreecommitdiffstats
path: root/gst/apetag
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-05-02 15:40:15 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-05-02 15:40:15 +0000
commit5c1e2a1e4458654d01fd5f77ab0c977d2f356e86 (patch)
treed5e8991efa7eb98aca203eb7addfc4d5d4a029e3 /gst/apetag
parent7df5ab1bf288e8648c5e2be8b80517783e69de5a (diff)
gst/: Post an error message when we get an EOS event and were not able to find out the type of stream.
Original commit message from CVS: * gst/apetag/gsttagdemux.c: (gst_tag_demux_init), (gst_tag_demux_sink_event): * gst/id3demux/gstid3demux.c: (gst_id3demux_init), (gst_id3demux_sink_event): Post an error message when we get an EOS event and were not able to find out the type of stream. * tests/check/elements/id3v2mux.c: (fill_mp3_buffer), (got_buffer), (test_taglib_id3mux_with_tags): Decrease num-buffers to 16 per iteration again, otherwise the many memcpy()s and reallocations in the test will hammer slow CPUs completely and make the test timeout.
Diffstat (limited to 'gst/apetag')
-rw-r--r--gst/apetag/gsttagdemux.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gst/apetag/gsttagdemux.c b/gst/apetag/gsttagdemux.c
index 53ca1881..6e56b14a 100644
--- a/gst/apetag/gsttagdemux.c
+++ b/gst/apetag/gsttagdemux.c
@@ -129,6 +129,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
static void gst_tag_demux_dispose (GObject * object);
static GstFlowReturn gst_tag_demux_chain (GstPad * pad, GstBuffer * buf);
+static gboolean gst_tag_demux_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_tag_demux_src_activate_pull (GstPad * pad, gboolean active);
static GstFlowReturn gst_tag_demux_read_range (GstTagDemux * tagdemux,
@@ -260,6 +261,8 @@ gst_tag_demux_init (GstTagDemux * demux, GstTagDemuxClass * gclass)
gst_pad_set_activate_function (demux->priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_tag_demux_sink_activate));
+ gst_pad_set_event_function (demux->priv->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_tag_demux_sink_event));
gst_pad_set_chain_function (demux->priv->sinkpad,
GST_DEBUG_FUNCPTR (gst_tag_demux_chain));
gst_element_add_pad (GST_ELEMENT (demux), demux->priv->sinkpad);
@@ -635,6 +638,31 @@ error:
}
static gboolean
+gst_tag_demux_sink_event (GstPad * pad, GstEvent * event)
+{
+ GstTagDemux *demux;
+ gboolean ret;
+
+ demux = GST_TAG_DEMUX (gst_pad_get_parent (pad));
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_EOS:
+ if (demux->priv->srcpad == NULL) {
+ GST_WARNING_OBJECT (demux, "EOS before we found a type");
+ GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL), (NULL));
+ }
+ ret = gst_pad_event_default (pad, event);
+ break;
+ default:
+ ret = gst_pad_event_default (pad, event);
+ break;
+ }
+
+ gst_object_unref (demux);
+ return ret;
+}
+
+static gboolean
gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux)
{
GstPad *peer = NULL;