mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
baseparse: Avoid overflow in update_interval calculation
https://bugzilla.gnome.org/show_bug.cgi?id=793284
This commit is contained in:
parent
25aed8c7ff
commit
a84b886a7d
1 changed files with 5 additions and 1 deletions
|
@ -3860,7 +3860,11 @@ gst_base_parse_set_frame_rate (GstBaseParse * parse, guint fps_num,
|
|||
gst_util_uint64_scale (GST_SECOND, fps_den * lead_out, fps_num);
|
||||
/* aim for about 1.5s to estimate duration */
|
||||
if (parse->priv->update_interval < 0) {
|
||||
parse->priv->update_interval = fps_num * 3 / (fps_den * 2);
|
||||
guint64 interval = gst_util_uint64_scale (fps_num, 3,
|
||||
G_GUINT64_CONSTANT (2) * fps_den);
|
||||
|
||||
parse->priv->update_interval = MIN (interval, G_MAXINT);
|
||||
|
||||
GST_LOG_OBJECT (parse, "estimated update interval to %d frames",
|
||||
parse->priv->update_interval);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue