From 0ed10542cc0ef7c590e3b8b9717ae26309dd494a Mon Sep 17 00:00:00 2001 From: Fredrik Noring Date: Sun, 4 Aug 2019 20:17:03 +0200 Subject: [PATCH] decoder/sidplay: Fix song length initialisation during container scan The song length was previously undetermined. --- NEWS | 2 ++ src/decoder/plugins/SidplayDecoderPlugin.cxx | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index febee603b..192c37357 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.14 (not yet released) +* decoder + - sidplay: show track durations in database ver 0.21.13 (2019/08/06) * input diff --git a/src/decoder/plugins/SidplayDecoderPlugin.cxx b/src/decoder/plugins/SidplayDecoderPlugin.cxx index 90d762dae..d38010872 100644 --- a/src/decoder/plugins/SidplayDecoderPlugin.cxx +++ b/src/decoder/plugins/SidplayDecoderPlugin.cxx @@ -547,6 +547,10 @@ sidplay_container_scan(Path path_fs) AddTagHandler h(tag_builder); ScanSidTuneInfo(info, i, n_tracks, h); + const SignedSongTime duration = get_song_length(tune); + if (!duration.IsNegative()) + h.OnDuration(SongTime(duration)); + char track_name[32]; /* Construct container/tune path names, eg. Delta.sid/tune_001.sid */