lib/alsa/NonBlock: move the functions into a class managing the state

This commit is contained in:
Max Kellermann
2018-11-11 07:34:08 +01:00
parent a958abde2f
commit 12308a0f55
5 changed files with 29 additions and 29 deletions

View File

@@ -148,10 +148,7 @@ class AlsaOutput final
*/
uint8_t *silence;
/**
* For PrepareAlsaPcmSockets().
*/
ReusableArray<pollfd> pfd_buffer;
AlsaNonBlockPcm non_block;
/**
* For copying data from OutputThread to IOThread.
@@ -881,7 +878,7 @@ AlsaOutput::PrepareSockets() noexcept
}
try {
return PrepareAlsaPcmSockets(*this, pcm, pfd_buffer);
return non_block.PrepareSockets(*this, pcm);
} catch (...) {
ClearSocketList();
LockCaughtError();