diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-09-10 22:14:03 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-09-13 14:20:35 +0200 |
commit | e93e898df528d013e2e0cfeba22e2b6d76bf99b6 (patch) | |
tree | ab921a035ce71311c126a1af7cb2bbcbfef6d024 /src/audio_core/sink/cubeb_sink.cpp | |
parent | Merge pull request #8842 from Kelebek1/AudOut (diff) | |
download | yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.tar yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.tar.gz yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.tar.bz2 yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.tar.lz yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.tar.xz yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.tar.zst yuzu-e93e898df528d013e2e0cfeba22e2b6d76bf99b6.zip |
Diffstat (limited to 'src/audio_core/sink/cubeb_sink.cpp')
-rw-r--r-- | src/audio_core/sink/cubeb_sink.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/src/audio_core/sink/cubeb_sink.cpp b/src/audio_core/sink/cubeb_sink.cpp index 9ae043611..36b115ad6 100644 --- a/src/audio_core/sink/cubeb_sink.cpp +++ b/src/audio_core/sink/cubeb_sink.cpp @@ -129,20 +129,13 @@ public: * Default false. */ void Start(bool resume = false) override { - if (!ctx) { + if (!ctx || !paused) { return; } - if (resume && was_playing) { - if (cubeb_stream_start(stream_backend) != CUBEB_OK) { - LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream"); - } - paused = false; - } else if (!resume) { - if (cubeb_stream_start(stream_backend) != CUBEB_OK) { - LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream"); - } - paused = false; + paused = false; + if (cubeb_stream_start(stream_backend) != CUBEB_OK) { + LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream"); } } @@ -151,16 +144,15 @@ public: */ void Stop() override { Unstall(); - if (!ctx) { + + if (!ctx || paused) { return; } + paused = true; if (cubeb_stream_stop(stream_backend) != CUBEB_OK) { LOG_CRITICAL(Audio_Sink, "Error stopping cubeb stream"); } - - was_playing.store(!paused); - paused = true; } private: @@ -286,18 +278,6 @@ void CubebSink::CloseStreams() { sink_streams.clear(); } -void CubebSink::PauseStreams() { - for (auto& stream : sink_streams) { - stream->Stop(); - } -} - -void CubebSink::UnpauseStreams() { - for (auto& stream : sink_streams) { - stream->Start(true); - } -} - f32 CubebSink::GetDeviceVolume() const { if (sink_streams.empty()) { return 1.0f; |