aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-07 21:31:10 +0200
committerMax Kellermann <max@duempel.org>2014-09-07 21:50:00 +0200
commita6bb27483b30f81145c19d1048a342c0aa5401d0 (patch)
treee12828eb7b00b8e4bb6db1099a26eb9d99ab7b78 /src
parent7ada7def9e797deb7a34ba8da1e33e207d4ed55f (diff)
downloadmpd-a6bb27483b30f81145c19d1048a342c0aa5401d0.tar.gz
mpd-a6bb27483b30f81145c19d1048a342c0aa5401d0.tar.xz
mpd-a6bb27483b30f81145c19d1048a342c0aa5401d0.zip
DecoderThread: clear the pipe when handling late SEEK
See code comment. Fixes assertion failure in decoder_command_finished().
Diffstat (limited to 'src')
-rw-r--r--src/DecoderThread.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index 72fc3cfb4..cf21534f0 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -26,6 +26,7 @@
#include "Song.hxx"
#include "system/FatalError.hxx"
#include "Mapper.hxx"
+#include "MusicPipe.hxx"
#include "fs/Traits.hxx"
#include "fs/AllocatedPath.hxx"
#include "DecoderAPI.hxx"
@@ -418,9 +419,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;