mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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:
parent
c940333d18
commit
f548bb9232
2 changed files with 2 additions and 4 deletions
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue