mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 21:55:24 +00:00
Recover from failed/restarted PulseAudio sessions by detecting sample
write errors, closing the device, then scheduling a retry in a second.
This commit is contained in:
parent
ad301fae9d
commit
4eff08a74d
@ -365,6 +365,11 @@ int PulseOut::Play(IBuffer *buffer, IBufferProvider* provider) {
|
||||
buffer->BufferPointer(),
|
||||
buffer->Samples() * sizeof(float),
|
||||
&error);
|
||||
|
||||
if (error > 0) {
|
||||
this->CloseDevice();
|
||||
return 1000; /* try again in a second */
|
||||
}
|
||||
}
|
||||
|
||||
provider->OnBufferProcessed(buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user