Remove pause callbacks from coretiming
This commit is contained in:
parent
cd4b9bffb2
commit
e93e898df5
15 changed files with 29 additions and 144 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue