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:
Max Kellermann 2009-11-02 20:20:14 +01:00
parent 408d52fe39
commit 55e3aa8179
1 changed files with 4 additions and 5 deletions

View File

@ -332,12 +332,11 @@ ao_play(struct audio_output *ao)
if (chunk != NULL)
/* continue the previous play() call */
chunk = chunk->next;
else {
else
chunk = music_pipe_peek(ao->pipe);
if (chunk == NULL)
/* no chunk available */
return false;
}
if (chunk == NULL)
/* no chunk available */
return false;
ao->chunk_finished = false;