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:
casey langen 2019-02-06 23:26:09 -08:00
parent ad301fae9d
commit 4eff08a74d

View File

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