input/alsa: rebase on AsyncInputStream

Use the snd_pcm_t only in the IOThread, and reuse code that is
well-known to work.
This commit is contained in:
Max Kellermann
2016-06-17 17:34:47 +02:00
parent 5d11759f7d
commit 95e53ac0a0
3 changed files with 62 additions and 60 deletions

View File

@@ -215,6 +215,17 @@ AsyncInputStream::Read(void *ptr, size_t read_size, Error &error)
return nbytes;
}
void
AsyncInputStream::CommitWriteBuffer(size_t nbytes)
{
buffer.Append(nbytes);
if (!IsReady())
SetReady();
else
cond.broadcast();
}
void
AsyncInputStream::AppendToBuffer(const void *data, size_t append_size)
{