From b7fdb7c6d71b7185ac54b94d7182219a51316210 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 23 Mar 2009 11:38:53 +0100 Subject: [PATCH] theoradec: Use GST_CLOCK_TIME_NONE for invalid positions. Fixes #543591 The problem was that previously we didn't check whether _theora_granule_frame returned a negative framecount or not, resulting in bogus timestamps. --- ext/theora/theoradec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index d9d8fcd137..60e2ef23cd 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -249,10 +249,11 @@ _theora_granule_start_time (GstTheoraDec * dec, gint64 granulepos) /* invalid granule results in invalid time */ if (granulepos == -1) - return -1; + return GST_CLOCK_TIME_NONE; /* get framecount */ - framecount = _theora_granule_frame (dec, granulepos); + if ((framecount = _theora_granule_frame (dec, granulepos)) < 0) + return GST_CLOCK_TIME_NONE; return gst_util_uint64_scale_int (framecount * GST_SECOND, dec->info.fps_denominator, dec->info.fps_numerator);