diff options
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r-- | src/decoder_thread.c | 6 |
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); |