mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
validate:scenario: Round results of expressions in a sensible way
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
This commit is contained in:
parent
19550bec3d
commit
521245fabd
1 changed files with 4 additions and 1 deletions
|
@ -848,7 +848,10 @@ gst_validate_action_get_clocktime (GstValidateScenario * scenario,
|
|||
} else if (val == -1.0) {
|
||||
*retval = GST_CLOCK_TIME_NONE;
|
||||
} else {
|
||||
*retval = val * GST_SECOND;
|
||||
gint n, d;
|
||||
|
||||
gst_util_double_to_fraction (val, &n, &d);
|
||||
*retval = gst_util_uint64_scale_int_round (n, GST_SECOND, d);
|
||||
}
|
||||
gst_structure_set (action->structure, name, G_TYPE_UINT64, *retval, NULL);
|
||||
g_free (strval);
|
||||
|
|
Loading…
Reference in a new issue