From 4374a905533b12a9f2b3ab58cc062c75f31aaca1 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 10 Jul 2012 17:58:22 +0200 Subject: [PATCH] dvbsuboverlay: ensure minimum page time out of 1 second ... to compensate for some bogus subtitle with a 0 timeout, which would result in only being shown for a very unreadable amount of time. See https://bugzilla.gnome.org/show_bug.cgi?id=666674 --- gst/dvbsuboverlay/gstdvbsuboverlay.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c index dd595c7035..6ea7fa6ea7 100644 --- a/gst/dvbsuboverlay/gstdvbsuboverlay.c +++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c @@ -764,6 +764,13 @@ new_dvb_subtitles_cb (DvbSub * dvb_sub, DVBSubtitles * subs, gpointer user_data) subs->page_time_out, subs->num_rects, subs->pts, GST_TIME_ARGS (subs->pts)); + /* spec says page_time_out is not to be taken very accurately anyway, + * and 0 does not make useful sense anyway */ + if (!subs->page_time_out) { + GST_WARNING_OBJECT (overlay, "overriding page_time_out 0"); + subs->page_time_out = 1; + } + /* clip and convert to running time */ start = subs->pts; stop = subs->pts + subs->page_time_out;