timeline: Fix wrong usage of scale_int

We are multiplying the framerate by GST_SECOND and thus have no
guarantee that it won't overflow.
This commit is contained in:
Thibault Saunier 2020-04-16 12:53:00 -04:00
parent c940333d18
commit f548bb9232
2 changed files with 2 additions and 4 deletions

View file

@ -230,6 +230,5 @@ ges_clip_asset_get_frame_time (GESClipAsset * self, GESFrameNumber frame_number)
if (!ges_clip_asset_get_natural_framerate (self, &fps_n, &fps_d)) if (!ges_clip_asset_get_natural_framerate (self, &fps_n, &fps_d))
return GST_CLOCK_TIME_NONE; return GST_CLOCK_TIME_NONE;
return gst_util_uint64_scale_int_ceil (frame_number, fps_d * GST_SECOND, return gst_util_uint64_scale_ceil (frame_number, fps_d * GST_SECOND, fps_n);
fps_n);
} }

View file

@ -3109,8 +3109,7 @@ ges_timeline_get_frame_time (GESTimeline * self, GESFrameNumber frame_number)
timeline_get_framerate (self, &fps_n, &fps_d); timeline_get_framerate (self, &fps_n, &fps_d);
return gst_util_uint64_scale_int_ceil (frame_number, return gst_util_uint64_scale_ceil (frame_number, fps_d * GST_SECOND, fps_n);
fps_d * GST_SECOND, fps_n);
} }
/** /**