From: Gilbok Lee Date: Thu, 14 Mar 2019 07:37:52 +0000 (+0900) Subject: subparse: Check the time is valid when calculating the duration X-Git-Tag: accepted/tizen/unified/20190318.150558~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b18f3f793ce4354cc7a2f6a7bc34503411073b4;p=platform%2Fupstream%2Fgst-plugins-base.git subparse: Check the time is valid when calculating the duration - In the case of sami subtitles, the duration for the last subtitle data is wrong. - The time value used to calculate the duraion is invalid, So the calculated duration is also wrong. - If the time is GST_CLOCK_TIME_NONE, the duration also be GST_CLOCK_TIME_NONE Change-Id: Ic3eff678430229879880dcbc8c13743ca6260252 --- diff --git a/gst/subparse/samiparse.c b/gst/subparse/samiparse.c index 0ed207e..88df038 100644 --- a/gst/subparse/samiparse.c +++ b/gst/subparse/samiparse.c @@ -1264,7 +1264,14 @@ parse_sami (ParserState * state, const gchar * line) ret = g_string_free (context->resultbuf, FALSE); context->resultbuf = g_string_new (""); state->start_time = context->time1; +#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION + if (!GST_CLOCK_TIME_IS_VALID(context->time2)) + state->duration = GST_CLOCK_TIME_NONE; + else + state->duration = context->time2 - context->time1; +#else state->duration = context->time2 - context->time1; +#endif context->has_result = FALSE; } #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION