diff options
| author | Michael M <mchtly@gmail.com> | 2017-10-21 12:49:34 -0700 |
|---|---|---|
| committer | Michael M <mchtly@gmail.com> | 2017-11-19 12:09:54 -0800 |
| commit | ad4a89d64b0d346553be473c1d877b34b896bfeb (patch) | |
| tree | 4670709c4f728e38cf27b08d085cdf62d788f1c0 /Source/Core/AudioCommon/CubebStream.cpp | |
| parent | 28f9034536b1615cbc9e24a051f584baafbb2026 (diff) | |
CubebStream: implement SetRunning
Diffstat (limited to 'Source/Core/AudioCommon/CubebStream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/CubebStream.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/Core/AudioCommon/CubebStream.cpp b/Source/Core/AudioCommon/CubebStream.cpp index a12f0fda4b..c2f3cc30cb 100644 --- a/Source/Core/AudioCommon/CubebStream.cpp +++ b/Source/Core/AudioCommon/CubebStream.cpp @@ -76,12 +76,23 @@ bool CubebStream::Start() return true; } -void CubebStream::Stop() +void CubebStream::SetRunning(bool running) { - if (cubeb_stream_stop(m_stream) != CUBEB_OK) + if (running) + { + if (cubeb_stream_start(m_stream) != CUBEB_OK) + ERROR_LOG(AUDIO, "Error starting cubeb stream"); + } + else { - ERROR_LOG(AUDIO, "Error stopping cubeb stream"); + if (cubeb_stream_stop(m_stream) != CUBEB_OK) + ERROR_LOG(AUDIO, "Error stopping cubeb stream"); } +} + +void CubebStream::Stop() +{ + SetRunning(false); cubeb_stream_destroy(m_stream); m_ctx.reset(); } |
