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
aafc9ce7
Commit
aafc9ce7
authored
Jun 10, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/gme: use class NarrowPath() for Windows compatibility
parent
fea32653
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+6
-4
No files found.
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
aafc9ce7
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "fs/Path.hxx"
#include "fs/Path.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "fs/FileSystem.hxx"
#include "fs/NarrowPath.hxx"
#include "util/ScopeExit.hxx"
#include "util/ScopeExit.hxx"
#include "util/StringCompare.hxx"
#include "util/StringCompare.hxx"
#include "util/StringFormat.hxx"
#include "util/StringFormat.hxx"
...
@@ -96,7 +97,7 @@ ParseContainerPath(Path path_fs)
...
@@ -96,7 +97,7 @@ ParseContainerPath(Path path_fs)
const
Path
base
=
path_fs
.
GetBase
();
const
Path
base
=
path_fs
.
GetBase
();
unsigned
track
;
unsigned
track
;
if
(
base
.
IsNull
()
||
if
(
base
.
IsNull
()
||
(
track
=
ParseSubtuneName
(
base
.
c_str
(
)))
<
1
)
(
track
=
ParseSubtuneName
(
NarrowPath
(
base
)))
<
1
)
return
{
AllocatedPath
(
path_fs
),
0
};
return
{
AllocatedPath
(
path_fs
),
0
};
return
{
path_fs
.
GetDirectoryName
(),
track
-
1
};
return
{
path_fs
.
GetDirectoryName
(),
track
-
1
};
...
@@ -120,20 +121,21 @@ LoadGmeAndM3u(GmeContainerPath container) {
...
@@ -120,20 +121,21 @@ LoadGmeAndM3u(GmeContainerPath container) {
Music_Emu
*
emu
;
Music_Emu
*
emu
;
const
char
*
gme_err
=
const
char
*
gme_err
=
gme_open_file
(
container
.
path
.
c_str
(
),
&
emu
,
GME_SAMPLE_RATE
);
gme_open_file
(
NarrowPath
(
container
.
path
),
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
nullptr
)
{
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
LogWarning
(
gme_domain
,
gme_err
);
return
nullptr
;
return
nullptr
;
}
}
const
auto
m3u_path
=
ReplaceSuffix
(
container
.
path
,
"m3u"
);
const
auto
m3u_path
=
ReplaceSuffix
(
container
.
path
,
PATH_LITERAL
(
"m3u"
));
/*
/*
* Some GME formats lose metadata if you attempt to
* Some GME formats lose metadata if you attempt to
* load a non-existant M3U file, so check that one
* load a non-existant M3U file, so check that one
* exists before loading.
* exists before loading.
*/
*/
if
(
!
m3u_path
.
IsNull
()
&&
FileExists
(
m3u_path
))
if
(
!
m3u_path
.
IsNull
()
&&
FileExists
(
m3u_path
))
gme_load_m3u
(
emu
,
m3u_path
.
c_str
(
));
gme_load_m3u
(
emu
,
NarrowPath
(
m3u_path
));
return
emu
;
return
emu
;
}
}
...
...
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