decoder/Thread: on late SEEK, start decoder at seek position

Previously, a bogus value (whatever happened to be still in
`start_time`) was used.
This commit is contained in:
Max Kellermann 2019-08-20 20:10:27 +02:00
parent ca450663d0
commit 44444e1b89
2 changed files with 6 additions and 0 deletions

1
NEWS
View File

@ -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

View File

@ -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