From 55e3aa81791f90589b9fd5fcef2daadcf72fa8b1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Nov 2009 20:20:14 +0100 Subject: 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). --- src/output_thread.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/output_thread.c') diff --git a/src/output_thread.c b/src/output_thread.c index 502599cb9..39b644e38 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -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; -- cgit v1.2.3