From 44444e1b89389b4430633676e0b27c6f2f37fb41 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 20 Aug 2019 20:10:27 +0200 Subject: [PATCH] decoder/Thread: on late SEEK, start decoder at seek position Previously, a bogus value (whatever happened to be still in `start_time`) was used. --- NEWS | 1 + src/decoder/Thread.cxx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 56ce212c9..d47a02aff 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ ver 0.21.14 (not yet released) - sidplay: strip text from "Date" tag * player - fix crash after song change + - fix seek position after restarting the decoder ver 0.21.13 (2019/08/06) * input 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