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
e96513c8
Commit
e96513c8
authored
Sep 22, 2017
by
John Regan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GME Plugin: try loading m3u sidecar files
parent
da9657aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+34
-16
No files found.
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
e96513c8
...
...
@@ -105,16 +105,39 @@ ParseContainerPath(Path path_fs)
return
{
path_fs
.
GetDirectoryName
(),
track
-
1
};
}
static
void
gme_file_decode
(
DecoderClient
&
client
,
Path
path_fs
)
{
const
auto
container
=
ParseContainerPath
(
path_fs
);
static
Music_Emu
*
LoadGmeAndM3u
(
GmeContainerPath
container
)
{
const
char
*
path
=
container
.
path
.
c_str
();
const
char
*
suffix
=
uri_get_suffix
(
path
);
Music_Emu
*
emu
;
const
char
*
gme_err
=
gme_open_file
(
container
.
path
.
c_str
()
,
&
emu
,
GME_SAMPLE_RATE
);
gme_open_file
(
path
,
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
return
nullptr
;
}
if
(
suffix
==
nullptr
)
{
return
emu
;
}
std
::
string
m3u_path
(
path
,
suffix
);
m3u_path
+=
"m3u"
;
gme_load_m3u
(
emu
,
m3u_path
.
c_str
());
return
emu
;
}
static
void
gme_file_decode
(
DecoderClient
&
client
,
Path
path_fs
)
{
const
auto
container
=
ParseContainerPath
(
path_fs
);
Music_Emu
*
emu
=
LoadGmeAndM3u
(
container
);
if
(
emu
==
nullptr
)
{
return
;
}
...
...
@@ -129,7 +152,7 @@ gme_file_decode(DecoderClient &client, Path path_fs)
#endif
gme_info_t
*
ti
;
gme_err
=
gme_track_info
(
emu
,
&
ti
,
container
.
track
);
const
char
*
gme_err
=
gme_track_info
(
emu
,
&
ti
,
container
.
track
);
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
return
;
...
...
@@ -255,11 +278,8 @@ gme_scan_file(Path path_fs,
{
const
auto
container
=
ParseContainerPath
(
path_fs
);
Music_Emu
*
emu
;
const
char
*
gme_err
=
gme_open_file
(
container
.
path
.
c_str
(),
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
Music_Emu
*
emu
=
LoadGmeAndM3u
(
container
);
if
(
emu
==
nullptr
)
{
return
false
;
}
...
...
@@ -272,12 +292,10 @@ static std::forward_list<DetachedSong>
gme_container_scan
(
Path
path_fs
)
{
std
::
forward_list
<
DetachedSong
>
list
;
const
auto
container
=
ParseContainerPath
(
path_fs
);
Music_Emu
*
emu
;
const
char
*
gme_err
=
gme_open_file
(
path_fs
.
c_str
(),
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
nullptr
)
{
LogWarning
(
gme_domain
,
gme_err
);
Music_Emu
*
emu
=
LoadGmeAndM3u
(
container
);
if
(
emu
==
nullptr
)
{
return
list
;
}
...
...
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