summaryrefslogtreecommitdiffstats
path: root/src/audio_core/sink/sdl2_sink.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_core/sink/sdl2_sink.cpp')
-rw-r--r--src/audio_core/sink/sdl2_sink.cpp27
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;