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
cd041f85
Commit
cd041f85
authored
Apr 13, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Plugin: container_scan() returns AllocatedString
parent
8ba33780
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
+11
-12
Container.cxx
src/db/update/Container.cxx
+5
-5
DecoderPlugin.hxx
src/decoder/DecoderPlugin.hxx
+2
-3
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+2
-2
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+2
-2
No files found.
src/db/update/Container.cxx
View file @
cd041f85
...
...
@@ -31,6 +31,7 @@
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "Log.hxx"
#include "util/AllocatedString.hxx"
Directory
*
UpdateWalk
::
MakeDirectoryIfModified
(
Directory
&
parent
,
const
char
*
name
,
...
...
@@ -95,16 +96,16 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
return
false
;
}
char
*
vtrack
;
AllocatedString
<>
vtrack
=
nullptr
;
unsigned
int
tnum
=
0
;
TagBuilder
tag_builder
;
while
((
vtrack
=
plugin
.
container_scan
(
pathname
,
++
tnum
))
!=
nullptr
)
{
Song
*
song
=
Song
::
NewFile
(
vtrack
,
*
contdir
);
Song
*
song
=
Song
::
NewFile
(
vtrack
.
c_str
()
,
*
contdir
);
// shouldn't be necessary but it's there..
song
->
mtime
=
info
.
mtime
;
const
auto
vtrack_fs
=
AllocatedPath
::
FromUTF8
(
vtrack
);
const
auto
vtrack_fs
=
AllocatedPath
::
FromUTF8
(
vtrack
.
c_str
()
);
// TODO: check vtrack_fs.IsNull()
const
auto
child_path_fs
=
AllocatedPath
::
Build
(
pathname
,
...
...
@@ -122,8 +123,7 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
modified
=
true
;
FormatDefault
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
vtrack
);
delete
[]
vtrack
;
directory
.
GetPath
(),
vtrack
.
c_str
());
}
if
(
tnum
==
1
)
{
...
...
src/decoder/DecoderPlugin.hxx
View file @
cd041f85
...
...
@@ -26,6 +26,7 @@ struct ConfigBlock;
class
InputStream
;
struct
TagHandler
;
class
Path
;
template
<
typename
T
>
class
AllocatedString
;
/**
* Opaque handle which the decoder plugin passes to the functions in
...
...
@@ -95,10 +96,8 @@ struct DecoderPlugin {
* @return nullptr if there are no multiple files
* a filename for every single track according to tnum (param 2)
* do not include full pathname here, just the "virtual" file
*
* Free the return value with delete[].
*/
char
*
(
*
container_scan
)(
Path
path_fs
,
const
unsigned
int
tnum
);
AllocatedString
<
char
>
(
*
container_scan
)(
Path
path_fs
,
unsigned
tnum
);
/* last element in these arrays must always be a nullptr: */
const
char
*
const
*
suffixes
;
...
...
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
cd041f85
...
...
@@ -103,7 +103,7 @@ ParseContainerPath(Path path_fs)
return
{
path_fs
.
GetDirectoryName
(),
track
-
1
};
}
static
char
*
static
AllocatedString
<>
gme_container_scan
(
Path
path_fs
,
const
unsigned
int
tnum
)
{
Music_Emu
*
emu
;
...
...
@@ -123,7 +123,7 @@ gme_container_scan(Path path_fs, const unsigned int tnum)
const
char
*
subtune_suffix
=
uri_get_suffix
(
path_fs
.
c_str
());
if
(
tnum
<=
num_songs
){
return
FormatString
(
SUBTUNE_PREFIX
"%03u.%s"
,
tnum
,
subtune_suffix
)
.
Steal
()
;
tnum
,
subtune_suffix
);
}
else
return
nullptr
;
}
...
...
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
cd041f85
...
...
@@ -336,7 +336,7 @@ sidplay_scan_file(Path path_fs,
return
true
;
}
static
char
*
static
AllocatedString
<>
sidplay_container_scan
(
Path
path_fs
,
const
unsigned
int
tnum
)
{
SidTune
tune
(
path_fs
.
c_str
(),
nullptr
,
true
);
...
...
@@ -353,7 +353,7 @@ sidplay_container_scan(Path path_fs, const unsigned int tnum)
/* Construct container/tune path names, eg.
Delta.sid/tune_001.sid */
if
(
tnum
<=
info
.
songs
)
{
return
FormatString
(
SUBTUNE_PREFIX
"%03u.sid"
,
tnum
)
.
Steal
()
;
return
FormatString
(
SUBTUNE_PREFIX
"%03u.sid"
,
tnum
);
}
else
return
nullptr
;
}
...
...
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