aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-06 00:42:01 +0100
committerMax Kellermann <max@duempel.org>2009-03-06 00:42:01 +0100
commit000b2d4f3a9c4f761ab918aaff4705621bb8559f (patch)
tree5009a5548c99155e00b4b14d52f50728a337960f /src/decoder_thread.c
parent10be8a8714b49bec5e6f869975962cbc26cebe61 (diff)
downloadmpd-000b2d4f3a9c4f761ab918aaff4705621bb8559f.tar.gz
mpd-000b2d4f3a9c4f761ab918aaff4705621bb8559f.tar.xz
mpd-000b2d4f3a9c4f761ab918aaff4705621bb8559f.zip
music_pipe: added music_pipe_push()
Added music_pipe_allocate(), music_pipe_push() and music_pipe_cancel(). Those functions allow the caller (decoder thread in this case) to do its own chunk management. The functions music_pipe_flush() and music_pipe_tag() can now be removed.
Diffstat (limited to '')
-rw-r--r--src/decoder_thread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index b35683e6e..97e92d295 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -98,6 +98,7 @@ static void decoder_run_song(const struct song *song, const char *uri)
decoder.seeking = false;
decoder.stream_tag = NULL;
decoder.decoder_tag = NULL;
+ decoder.chunk = NULL;
dc.state = DECODE_STATE_START;
dc.command = DECODE_COMMAND_NONE;
@@ -194,7 +195,10 @@ static void decoder_run_song(const struct song *song, const char *uri)
pcm_convert_deinit(&decoder.conv_state);
- music_pipe_flush();
+ /* flush the last chunk */
+ if (decoder.chunk != NULL &&
+ decoder_flush_chunk(&decoder, NULL) != DECODE_COMMAND_NONE)
+ music_pipe_cancel(decoder.chunk);
if (close_instream)
input_stream_close(&input_stream);