From a5ca43b7dd3e592358f3cb4e5507d9b9a1d6f51f Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 13 Oct 2016 21:29:18 +0200 Subject: [PATCH] [DEV] remove dependency of unistd.h --- audio/river/Interface.cpp | 2 +- sample/read/read.cpp | 5 +++-- sample/write/write.cpp | 5 +++-- test/main.cpp | 2 +- test/testEchoDelay.hpp | 6 +++--- test/testFormat.hpp | 12 ++++++------ test/testMuxer.hpp | 4 ++-- test/testPlaybackCallback.hpp | 8 ++++---- test/testPlaybackWrite.hpp | 8 ++++---- test/testRecordCallback.hpp | 4 ++-- test/testVolume.hpp | 26 +++++++++++++------------- 11 files changed, 42 insertions(+), 40 deletions(-) diff --git a/audio/river/Interface.cpp b/audio/river/Interface.cpp index 6ca6433..6b0b45c 100644 --- a/audio/river/Interface.cpp +++ b/audio/river/Interface.cpp @@ -252,7 +252,7 @@ std::vector audio::river::Interface::read(size_t _nbChunk) { int32_t nbChunkBuffer = m_circularBuffer.size() / m_map.size(); m_mutex.unlock(); while (nbChunkBuffer < _nbChunk) { - usleep(1000); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); nbChunkBuffer = m_circularBuffer.size() / m_map.size(); } m_mutex.lock(); diff --git a/sample/read/read.cpp b/sample/read/read.cpp index 5343444..dc5765b 100644 --- a/sample/read/read.cpp +++ b/sample/read/read.cpp @@ -12,7 +12,8 @@ //! [audio_river_sample_include] #include #include -#include +#include + //! [audio_river_sample_read_config_file] @@ -148,7 +149,7 @@ int main(int _argc, const char **_argv) { // start the stream interface->start(); // wait 10 second ... - sleep(10); + std::this_thread::sleep_for(std::chrono::seconds(10)); // stop the stream interface->stop(); //! [audio_river_sample_read_start_stop] diff --git a/sample/write/write.cpp b/sample/write/write.cpp index 69f3579..daf9eb8 100644 --- a/sample/write/write.cpp +++ b/sample/write/write.cpp @@ -10,7 +10,8 @@ #include