From 84b52f6eb4f7141b084531f15a8d9ad48443e52e Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Wed, 1 Dec 2010 07:06:35 +0200 Subject: [PATCH] dvbsuboverlay: Implement fallback page_time_out honoring The spec has a page_time_out in the page composition segment to ensure subtitles don't get stuck on screen for too much longer than intended, when future page composition segments get lost on bad reception, or other problems. Honor it in the gst plugin side. --- gst/dvbsuboverlay/gstdvbsuboverlay.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c index 9d86c78..60c4518 100644 --- a/gst/dvbsuboverlay/gstdvbsuboverlay.c +++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c @@ -1118,6 +1118,18 @@ gst_dvbsub_overlay_chain_video (GstPad * pad, GstBuffer * buffer) } } + /* Check that we haven't hit the fallback timeout for current subtitle page */ + if (overlay->current_subtitle + && vid_running_time > + (overlay->current_subtitle->pts + + (overlay->current_subtitle->page_time_out * GST_SECOND))) { + GST_INFO_OBJECT (overlay, + "Subtitle page not redefined before fallback page_time_out of %u seconds (missed data?) - deleting current page", + overlay->current_subtitle->page_time_out); + dvb_subtitles_free (overlay->current_subtitle); + overlay->current_subtitle = NULL; + } + ret = gst_pad_push (overlay->srcpad, buffer); return ret; -- 2.7.4