[gst-plugins-farsight/master] Ignore upstream newsegment events in mimdec
Olivier Crete
olivier.crete at collabora.co.uk
Tue Mar 3 10:53:15 PST 2009
20080725193358-3e2dc-7c0f22386e0208a45eae9c1d7eb62e86f61d14ba.gz
---
ext/mimic/gstmimdec.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/ext/mimic/gstmimdec.c b/ext/mimic/gstmimdec.c
index a58a03b..9e97a30 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;
+}
--
1.5.6.5
More information about the farsight-commits
mailing list