summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-08-20 20:10:27 +0200
committerMax Kellermann <max@musicpd.org>2019-08-20 20:15:08 +0200
commit44444e1b89389b4430633676e0b27c6f2f37fb41 (patch)
tree558ec87239689a20efd828075e35436e33891a33 /src
parentca450663d09b0e467292aaa17f636db71b95d574 (diff)
decoder/Thread: on late SEEK, start decoder at seek position
Previously, a bogus value (whatever happened to be still in `start_time`) was used.
Diffstat (limited to 'src')
-rw-r--r--src/decoder/Thread.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/decoder/Thread.cxx b/src/decoder/Thread.cxx
index 9021af57a..45129a206 100644
--- a/src/decoder/Thread.cxx
+++ b/src/decoder/Thread.cxx
@@ -455,6 +455,11 @@ static void
decoder_run_song(DecoderControl &dc,
const DetachedSong &song, const char *uri, Path path_fs)
{
+ if (dc.command == DecoderCommand::SEEK)
+ /* if the SEEK command arrived too late, start the
+ decoder at the seek position */
+ dc.start_time = dc.seek_time;
+
DecoderBridge bridge(dc, dc.start_time.IsPositive(),
/* pass the song tag only if it's
authoritative, i.e. if it's a local