summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Crete <olivier.crete@collabora.co.uk>2008-07-25 19:33:58 +0000
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-03-03 14:34:07 -0500
commitca535657199814980d3faa8a5c76be78f6d4033b (patch)
tree8744810a636d2d1d9cf3ce93637678c98b864fce
parenta66cd2591929498dd0af6118a82d7bcfb6171b0d (diff)
downloadgst-plugins-bad-ca535657199814980d3faa8a5c76be78f6d4033b.tar.gz
gst-plugins-bad-ca535657199814980d3faa8a5c76be78f6d4033b.tar.bz2
gst-plugins-bad-ca535657199814980d3faa8a5c76be78f6d4033b.zip
[MOVED FROM GST-P-FARSIGHT] Ignore upstream newsegment events in mimdec
20080725193358-3e2dc-7c0f22386e0208a45eae9c1d7eb62e86f61d14ba.gz
-rw-r--r--ext/mimic/gstmimdec.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/mimic/gstmimdec.c b/ext/mimic/gstmimdec.c
index a58a03ba..9e97a300 100644
--- a/ext/mimic/gstmimdec.c
+++ b/ext/mimic/gstmimdec.c
@@ -67,6 +67,8 @@ static GstStateChangeReturn
gst_mimdec_change_state (GstElement *element,
GstStateChange transition);
+static gboolean gst_mimdec_sink_event (GstPad *pad, GstEvent *event);
+
GST_BOILERPLATE (GstMimDec, gst_mimdec, GstElement, GST_TYPE_ELEMENT);
@@ -114,6 +116,7 @@ gst_mimdec_init (GstMimDec *mimdec, GstMimDecClass *klass)
gst_static_pad_template_get (&sink_factory), "sink");
gst_element_add_pad (GST_ELEMENT (mimdec), mimdec->sinkpad);
gst_pad_set_chain_function (mimdec->sinkpad, gst_mimdec_chain);
+ gst_pad_set_event_function (mimdec->sinkpad, gst_mimdec_sink_event);
mimdec->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get (&src_factory), "src");
@@ -341,3 +344,23 @@ gst_mimdec_change_state (GstElement *element, GstStateChange transition)
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
}
+
+static gboolean
+gst_mimdec_sink_event (GstPad *pad, GstEvent *event)
+{
+ gboolean res = TRUE;
+ GstMimDec *mimdec = GST_MIMDEC (gst_pad_get_parent (pad));
+
+ /*
+ * Ignore upstream newsegment event, its EVIL, we should implement
+ * proper seeking instead
+ */
+ if (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT)
+ gst_event_unref (event);
+ else
+ res = gst_pad_push_event (mimdec->srcpad, event);
+
+ gst_object_unref (mimdec);
+
+ return TRUE;
+}