Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
96b48a24
Commit
96b48a24
authored
Dec 04, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sidplay: pass parsed path to get_song_length()
Eliminates duplicate ParseContainerPath() call.
parent
9612975c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+3
-4
No files found.
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
96b48a24
...
@@ -151,12 +151,11 @@ ParseContainerPath(Path path_fs)
...
@@ -151,12 +151,11 @@ ParseContainerPath(Path path_fs)
/* get the song length in seconds */
/* get the song length in seconds */
static
SignedSongTime
static
SignedSongTime
get_song_length
(
Path
path_fs
)
get_song_length
(
const
SidplayContainerPath
&
container
)
{
{
if
(
songlength_database
==
nullptr
)
if
(
songlength_database
==
nullptr
)
return
SignedSongTime
::
Negative
();
return
SignedSongTime
::
Negative
();
const
auto
container
=
ParseContainerPath
(
path_fs
);
SidTuneMod
tune
(
container
.
path
.
c_str
());
SidTuneMod
tune
(
container
.
path
.
c_str
());
if
(
!
tune
)
{
if
(
!
tune
)
{
LogWarning
(
sidplay_domain
,
LogWarning
(
sidplay_domain
,
...
@@ -209,7 +208,7 @@ sidplay_file_decode(Decoder &decoder, Path path_fs)
...
@@ -209,7 +208,7 @@ sidplay_file_decode(Decoder &decoder, Path path_fs)
const
int
song_num
=
container
.
track
;
const
int
song_num
=
container
.
track
;
tune
.
selectSong
(
song_num
);
tune
.
selectSong
(
song_num
);
auto
duration
=
get_song_length
(
path_fs
);
auto
duration
=
get_song_length
(
container
);
if
(
duration
.
IsNegative
()
&&
default_songlength
>
0
)
if
(
duration
.
IsNegative
()
&&
default_songlength
>
0
)
duration
=
SongTime
::
FromS
(
default_songlength
);
duration
=
SongTime
::
FromS
(
default_songlength
);
...
@@ -373,7 +372,7 @@ sidplay_scan_file(Path path_fs,
...
@@ -373,7 +372,7 @@ sidplay_scan_file(Path path_fs,
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
TAG_TRACK
,
track
);
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
TAG_TRACK
,
track
);
/* time */
/* time */
const
auto
duration
=
get_song_length
(
path_fs
);
const
auto
duration
=
get_song_length
(
container
);
if
(
!
duration
.
IsNegative
())
if
(
!
duration
.
IsNegative
())
tag_handler_invoke_duration
(
handler
,
handler_ctx
,
tag_handler_invoke_duration
(
handler
,
handler_ctx
,
SongTime
(
duration
));
SongTime
(
duration
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment