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.
This commit is contained in:
Edward Hervey 2009-03-23 11:38:53 +01:00
parent 9f0e053f6e
commit b7fdb7c6d7

View file

@ -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);