{input,mixer}/alsa: move code to lib/alsa/NonBlock.cxx

This commit is contained in:
Max Kellermann
2017-02-08 19:35:27 +01:00
parent 67a958a326
commit 9e503b21c1
5 changed files with 121 additions and 26 deletions

View File

@@ -18,6 +18,7 @@
*/
#include "config.h"
#include "lib/alsa/NonBlock.hxx"
#include "mixer/MixerInternal.hxx"
#include "mixer/Listener.hxx"
#include "output/OutputAPI.hxx"
@@ -108,18 +109,7 @@ AlsaMixerMonitor::PrepareSockets()
return std::chrono::steady_clock::duration(-1);
}
int count = snd_mixer_poll_descriptors_count(mixer);
if (count <= 0)
count = 0;
struct pollfd *pfds = pfd_buffer.Get(count);
count = snd_mixer_poll_descriptors(mixer, pfds, count);
if (count < 0)
count = 0;
ReplaceSocketList(pfds, count);
return std::chrono::steady_clock::duration(-1);
return PrepareAlsaMixerSockets(*this, mixer, pfd_buffer);
}
void