diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-11-06 19:26:21 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-07 19:28:25 +0100 |
commit | dc892d0b2b44397c6b13560c71e277f1ee283e1b (patch) | |
tree | 35dec4f5368cb0a676224c685cc44b299a999ae6 /ext/assrender | |
parent | 0fd058520ccf41e3eb55ba1e9170154329d7d200 (diff) | |
download | gstreamer-plugins-bad-dc892d0b2b44397c6b13560c71e277f1ee283e1b.tar.gz |
assrender: don't send flush events on seeks
It's for the upstream element driving the pipeline to
handle seeks and send flush events or not, filters
should not interfere here, otherwise downstream pads
could be flushing before upstream pads are flushing,
which can result in GST_FLOW_ERROR being sent instead
of GST_FLOW_FLUSHING when trying to forward sticky
events at just the wrong moment.
Diffstat (limited to 'ext/assrender')
-rw-r--r-- | ext/assrender/gstassrender.c | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/ext/assrender/gstassrender.c b/ext/assrender/gstassrender.c index 056ebead1..de76af0cd 100644 --- a/ext/assrender/gstassrender.c +++ b/ext/assrender/gstassrender.c @@ -446,54 +446,16 @@ static gboolean gst_ass_render_event_src (GstPad * pad, GstObject * parent, GstEvent * event) { GstAssRender *render = GST_ASS_RENDER (parent); - gboolean ret = FALSE; + gboolean ret; GST_DEBUG_OBJECT (render, "received src event %" GST_PTR_FORMAT, event); - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_SEEK:{ - GstSeekFlags flags; - - if (!render->track_init_ok) { - GST_DEBUG_OBJECT (render, "seek received, pushing upstream"); - ret = gst_pad_push_event (render->video_sinkpad, event); - return ret; - } - - GST_DEBUG_OBJECT (render, "seek received, driving from here"); - - gst_event_parse_seek (event, NULL, NULL, &flags, NULL, NULL, NULL, NULL); - - /* Flush downstream, only for flushing seek */ - if (flags & GST_SEEK_FLAG_FLUSH) - gst_pad_push_event (render->srcpad, gst_event_new_flush_start ()); - - /* Mark subtitle as flushing, unblocks chains */ - GST_ASS_RENDER_LOCK (render); - render->subtitle_flushing = TRUE; - render->video_flushing = TRUE; - gst_ass_render_pop_text (render); - GST_ASS_RENDER_UNLOCK (render); - - /* Seek on each sink pad */ - gst_event_ref (event); - ret = gst_pad_push_event (render->video_sinkpad, event); - if (ret) { - ret = gst_pad_push_event (render->text_sinkpad, event); - } else { - gst_event_unref (event); - } - break; - } - default: - if (render->track_init_ok) { - gst_event_ref (event); - ret = gst_pad_push_event (render->video_sinkpad, event); - gst_pad_push_event (render->text_sinkpad, event); - } else { - ret = gst_pad_push_event (render->video_sinkpad, event); - } - break; + /* FIXME: why not just always push it on text pad? */ + if (render->track_init_ok) { + ret = gst_pad_push_event (render->video_sinkpad, gst_event_ref (event)); + gst_pad_push_event (render->text_sinkpad, event); + } else { + ret = gst_pad_push_event (render->video_sinkpad, event); } return ret; |