Fixed overflow issue. Code originally meant to truncate the 64 bit integer did not...
[ardour.git] / gtk2_ardour / ardour_ui2.cc
index 8a29e64c6d2fa0faff4b73dd34a4198de81c211a..44d0b1a4232bcc1854f4efda531e274de89686bd 100644 (file)
@@ -755,17 +755,13 @@ ARDOUR_UI::set_shuttle_fract (double f)
 void
 ARDOUR_UI::use_shuttle_fract (bool force)
 {
-       struct timeval now;
-       struct timeval diff;
+       microseconds_t now = get_microseconds();
        
        /* do not attempt to submit a motion-driven transport speed request
           more than once per process cycle.
         */
 
-       gettimeofday (&now, 0);
-       timersub (&now, &last_shuttle_request, &diff);
-
-       if (!force && (diff.tv_usec + (diff.tv_sec * 1000000)) < engine->usecs_per_cycle()) {
+       if (!force && (last_shuttle_request - now) < (microseconds_t) engine->usecs_per_cycle()) {
                return;
        }