aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/SidplayDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-04 21:20:32 +0100
committerMax Kellermann <max@duempel.org>2014-12-04 21:21:49 +0100
commit7552dff0e56befa091d889cdb56f7d881d985a5a (patch)
tree2a75c98b13ef089c08f198b509024bf93fbf3fa0 /src/decoder/plugins/SidplayDecoderPlugin.cxx
parent110589c0f3b57f08e85c83fc98afaf2bd9b8c6fa (diff)
downloadmpd-7552dff0e56befa091d889cdb56f7d881d985a5a.tar.gz
mpd-7552dff0e56befa091d889cdb56f7d881d985a5a.tar.xz
mpd-7552dff0e56befa091d889cdb56f7d881d985a5a.zip
decoder/sidplay: pass parsed path to get_song_length()
Eliminates duplicate ParseContainerPath() call.
Diffstat (limited to 'src/decoder/plugins/SidplayDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/SidplayDecoderPlugin.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/decoder/plugins/SidplayDecoderPlugin.cxx b/src/decoder/plugins/SidplayDecoderPlugin.cxx
index 83e4eb272..cd8dc395a 100644
--- a/src/decoder/plugins/SidplayDecoderPlugin.cxx
+++ b/src/decoder/plugins/SidplayDecoderPlugin.cxx
@@ -151,12 +151,11 @@ ParseContainerPath(Path path_fs)
/* get the song length in seconds */
static SignedSongTime
-get_song_length(Path path_fs)
+get_song_length(const SidplayContainerPath &container)
{
if (songlength_database == nullptr)
return SignedSongTime::Negative();
- const auto container = ParseContainerPath(path_fs);
SidTuneMod tune(container.path.c_str());
if(!tune) {
LogWarning(sidplay_domain,
@@ -209,7 +208,7 @@ sidplay_file_decode(Decoder &decoder, Path path_fs)
const int song_num = container.track;
tune.selectSong(song_num);
- auto duration = get_song_length(path_fs);
+ auto duration = get_song_length(container);
if (duration.IsNegative() && default_songlength > 0)
duration = SongTime::FromS(default_songlength);
@@ -373,7 +372,7 @@ sidplay_scan_file(Path path_fs,
tag_handler_invoke_tag(handler, handler_ctx, TAG_TRACK, track);
/* time */
- const auto duration = get_song_length(path_fs);
+ const auto duration = get_song_length(container);
if (!duration.IsNegative())
tag_handler_invoke_duration(handler, handler_ctx,
SongTime(duration));