Remove pause callbacks from coretiming

This commit is contained in:
Kelebek1
2022-09-10 21:14:03 +01:00
parent cd4b9bffb2
commit e93e898df5
15 changed files with 29 additions and 144 deletions

View File

@ -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;