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/sdl2_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 '')
-rw-r--r-- | src/audio_core/sink/sdl2_sink.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index 7ee1dd7cd..1bd001b94 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -108,17 +108,12 @@ public: * Default false. */ void Start(bool resume = false) override { - if (device == 0) { + if (device == 0 || !paused) { return; } - if (resume && was_playing) { - SDL_PauseAudioDevice(device, 0); - paused = false; - } else if (!resume) { - SDL_PauseAudioDevice(device, 0); - paused = false; - } + paused = false; + SDL_PauseAudioDevice(device, 0); } /** @@ -126,11 +121,11 @@ public: */ void Stop() override { Unstall(); - if (device == 0) { + if (device == 0 || paused) { return; } - SDL_PauseAudioDevice(device, 1); paused = true; + SDL_PauseAudioDevice(device, 1); } private: @@ -207,18 +202,6 @@ void SDLSink::CloseStreams() { sink_streams.clear(); } -void SDLSink::PauseStreams() { - for (auto& stream : sink_streams) { - stream->Stop(); - } -} - -void SDLSink::UnpauseStreams() { - for (auto& stream : sink_streams) { - stream->Start(); - } -} - f32 SDLSink::GetDeviceVolume() const { if (sink_streams.empty()) { return 1.0f; |