mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-24 13:13:17 -05:00
Return silence if the pipe read was blocked (credit bfitz)
This commit is contained in:
parent
d61dc295e8
commit
9508eba62e
@ -108,14 +108,15 @@ pipe_audio_get(struct evbuffer *evbuf, int wanted)
|
|||||||
|
|
||||||
got = read(g_fd, g_buf, wanted);
|
got = read(g_fd, g_buf, wanted);
|
||||||
|
|
||||||
if (got < 0)
|
if ((got < 0) && (errno != EAGAIN))
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_PLAYER, "Could not read from pipe: %s\n", strerror(errno));
|
DPRINTF(E_LOG, L_PLAYER, "Could not read from pipe: %s\n", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the other end of the pipe is not writing we just return silence
|
// If the other end of the pipe is not writing or the read was blocked,
|
||||||
if (got == 0)
|
// we just return silence
|
||||||
|
if (got <= 0)
|
||||||
{
|
{
|
||||||
memset(g_buf, 0, wanted);
|
memset(g_buf, 0, wanted);
|
||||||
got = wanted;
|
got = wanted;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user