From 83a8835a65a302aa796e8b02af612bb0084a1e9e Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 27 May 2015 16:41:00 +0200 Subject: [PATCH] validate:scenario: Round up computed ClockTime values Otherwise we end up with rounding error and instead of seeking to 0.1 we seek to 0.09999999999 for example Reviewers: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D203 --- validate/gst/validate/gst-validate-scenario.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index f29616bab1..14a86a7aed 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -461,8 +461,10 @@ gst_validate_action_get_clocktime (GstValidateScenario * scenario, if (val == -1.0) *retval = GST_CLOCK_TIME_NONE; - else + else { *retval = val * GST_SECOND; + *retval = GST_ROUND_UP_4 (*retval); + } return TRUE; }