mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-29 07:26:02 -05:00
[player] Fix segfault if reading from source failed for all queue items
This commit is contained in:
parent
2a610812a5
commit
7592462571
@ -1512,7 +1512,7 @@ source_read(uint8_t *buf, int len, uint64_t rtptime)
|
|||||||
{
|
{
|
||||||
ret = stream_read(cur_streaming, len - nbytes);
|
ret = stream_read(cur_streaming, len - nbytes);
|
||||||
}
|
}
|
||||||
else
|
else if (cur_playing)
|
||||||
{
|
{
|
||||||
// Reached end of playlist (cur_playing is NULL) send silence and source_check will abort playback if the last item was played
|
// Reached end of playlist (cur_playing is NULL) send silence and source_check will abort playback if the last item was played
|
||||||
DPRINTF(E_SPAM, L_PLAYER, "End of playlist reached, stream silence until playback of last item ends\n");
|
DPRINTF(E_SPAM, L_PLAYER, "End of playlist reached, stream silence until playback of last item ends\n");
|
||||||
@ -1521,6 +1521,11 @@ source_read(uint8_t *buf, int len, uint64_t rtptime)
|
|||||||
free(silence_buf);
|
free(silence_buf);
|
||||||
ret = len - nbytes;
|
ret = len - nbytes;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If cur_streaming and cur_playing are NULL, source_read for all queue items failed. Playback will be aborted in the calling function
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user