From 6bf8249b4b14c54f53bdfc96b0dc3025a6eaebb6 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Tue, 13 May 2014 15:10:32 +1000 Subject: [PATCH] Use Glib::usleep in DummyAudioBackend rather than ::usleep --- libs/backends/dummy/dummy_audiobackend.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/backends/dummy/dummy_audiobackend.cc b/libs/backends/dummy/dummy_audiobackend.cc index 6bc6e6da6e..136e5b8655 100644 --- a/libs/backends/dummy/dummy_audiobackend.cc +++ b/libs/backends/dummy/dummy_audiobackend.cc @@ -20,6 +20,8 @@ #include #include +#include + #include "dummy_audiobackend.h" #include "pbd/error.h" #include "i18n.h" @@ -302,7 +304,7 @@ DummyAudioBackend::_start (bool /*for_latency_measurement*/) } int timeout = 5000; - while (!_running && --timeout > 0) { usleep (1000); } + while (!_running && --timeout > 0) { Glib::usleep (1000); } if (timeout == 0 || !_running) { PBD::error << _("DummyAudioBackend: failed to start process thread.") << endmsg; @@ -992,13 +994,13 @@ DummyAudioBackend::main_process_thread () const int nomial_time = 1000000 * _samples_per_period / _samplerate; _dsp_load = elapsed_time / (float) nomial_time; if (elapsed_time < nomial_time) { - ::usleep (nomial_time - elapsed_time); + Glib::usleep (nomial_time - elapsed_time); } else { - ::usleep (100); // don't hog cpu + Glib::usleep (100); // don't hog cpu } } else { _dsp_load = 1.0; - ::usleep (100); // don't hog cpu + Glib::usleep (100); // don't hog cpu } ::gettimeofday (&clock1, NULL); }