aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/DecoderThread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/DecoderThread.cxx')
-rw-r--r--src/decoder/DecoderThread.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx
index 3f4f7c42e..b2b41b661 100644
--- a/src/decoder/DecoderThread.cxx
+++ b/src/decoder/DecoderThread.cxx
@@ -25,6 +25,7 @@
#include "DecoderPlugin.hxx"
#include "DetachedSong.hxx"
#include "system/FatalError.hxx"
+#include "MusicPipe.hxx"
#include "fs/Traits.hxx"
#include "fs/AllocatedPath.hxx"
#include "DecoderAPI.hxx"
@@ -449,9 +450,18 @@ decoder_task(void *arg)
dc.replay_gain_prev_db = dc.replay_gain_db;
dc.replay_gain_db = 0;
- /* fall through */
+ decoder_run(dc);
+ break;
case DecoderCommand::SEEK:
+ /* this seek was too late, and the decoder had
+ already finished; start a new decoder */
+
+ /* we need to clear the pipe here; usually the
+ PlayerThread is responsible, but it is not
+ aware that the decoder has finished */
+ dc.pipe->Clear(*dc.buffer);
+
decoder_run(dc);
break;