output_thread: return from ao_play() if chunk->next is NULL
When the "next" chunk to be played is NULL, return from ao_play() immediately, without going over the "while" loop (no-op).
This commit is contained in:
@@ -332,12 +332,11 @@ ao_play(struct audio_output *ao)
|
|||||||
if (chunk != NULL)
|
if (chunk != NULL)
|
||||||
/* continue the previous play() call */
|
/* continue the previous play() call */
|
||||||
chunk = chunk->next;
|
chunk = chunk->next;
|
||||||
else {
|
else
|
||||||
chunk = music_pipe_peek(ao->pipe);
|
chunk = music_pipe_peek(ao->pipe);
|
||||||
if (chunk == NULL)
|
if (chunk == NULL)
|
||||||
/* no chunk available */
|
/* no chunk available */
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
ao->chunk_finished = false;
|
ao->chunk_finished = false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user