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
a547d2aa
Commit
a547d2aa
authored
Dec 04, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sidplay: use config_param::GetBlockPath()
parent
c0130268
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+12
-7
No files found.
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
a547d2aa
...
...
@@ -25,7 +25,9 @@
#include "fs/AllocatedPath.hxx"
#include "util/FormatString.hxx"
#include "util/Domain.hxx"
#include "util/Error.hxx"
#include "system/ByteOrder.hxx"
#include "system/FatalError.hxx"
#include "Log.hxx"
#include <errno.h>
...
...
@@ -49,16 +51,16 @@ static unsigned default_songlength;
static
bool
filter_setting
;
static
GKeyFile
*
sidplay_load_songlength_db
(
const
char
*
path
)
sidplay_load_songlength_db
(
const
Path
path
)
{
GError
*
error
=
nullptr
;
gchar
*
data
;
gsize
size
;
if
(
!
g_file_get_contents
(
path
,
&
data
,
&
size
,
&
error
))
{
if
(
!
g_file_get_contents
(
path
.
c_str
()
,
&
data
,
&
size
,
&
error
))
{
FormatError
(
sidplay_domain
,
"unable to read songlengths file %s: %s"
,
path
,
error
->
message
);
path
.
c_str
()
,
error
->
message
);
g_error_free
(
error
);
return
nullptr
;
}
...
...
@@ -75,7 +77,7 @@ sidplay_load_songlength_db(const char *path)
if
(
!
success
)
{
FormatError
(
sidplay_domain
,
"unable to parse songlengths file %s: %s"
,
path
,
error
->
message
);
path
.
c_str
()
,
error
->
message
);
g_error_free
(
error
);
g_key_file_free
(
db
);
return
nullptr
;
...
...
@@ -89,9 +91,12 @@ static bool
sidplay_init
(
const
config_param
&
param
)
{
/* read the songlengths database file */
const
char
*
songlength_file
=
param
.
GetBlockValue
(
"songlength_database"
);
if
(
songlength_file
!=
nullptr
)
songlength_database
=
sidplay_load_songlength_db
(
songlength_file
);
Error
error
;
const
auto
database_path
=
param
.
GetBlockPath
(
"songlength_database"
,
error
);
if
(
!
database_path
.
IsNull
())
songlength_database
=
sidplay_load_songlength_db
(
database_path
);
else
if
(
error
.
IsDefined
())
FatalError
(
error
);
default_songlength
=
param
.
GetBlockValue
(
"default_songlength"
,
0u
);
...
...
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