Commit 55e3aa81 authored by Max Kellermann's avatar Max Kellermann

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).
parent 408d52fe
...@@ -332,12 +332,11 @@ ao_play(struct audio_output *ao) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment