From: Mark Nauwelaerts Date: Wed, 5 Sep 2012 09:42:05 +0000 (+0200) Subject: pango: handle GAP event to update text position X-Git-Tag: 1.19.3~511^2~5961 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3545604c0b19826b9bcb500246270d1b2f98863;p=platform%2Fupstream%2Fgstreamer.git pango: handle GAP event to update text position --- diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 21d658c..d60c070 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -1762,6 +1762,23 @@ gst_base_text_overlay_text_event (GstPad * pad, GstObject * parent, GST_BASE_TEXT_OVERLAY_UNLOCK (overlay); break; } + case GST_EVENT_GAP: + { + GstClockTime start, duration; + + gst_event_parse_gap (event, &start, &duration); + if (GST_CLOCK_TIME_IS_VALID (duration)) + start += duration; + /* we do not expect another buffer until after gap, + * so that is our position now */ + overlay->text_segment.position = start; + + /* wake up the video chain, it might be waiting for a text buffer or + * a text segment update */ + GST_BASE_TEXT_OVERLAY_LOCK (overlay); + GST_BASE_TEXT_OVERLAY_BROADCAST (overlay); + GST_BASE_TEXT_OVERLAY_UNLOCK (overlay); + } case GST_EVENT_FLUSH_STOP: GST_BASE_TEXT_OVERLAY_LOCK (overlay); GST_INFO_OBJECT (overlay, "text flush stop");