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
e2a0fd7a
Commit
e2a0fd7a
authored
Feb 07, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/cue/CueParser: Get() returns std::unique_ptr
parent
5869a4ba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
11 deletions
+13
-11
CueParser.cxx
src/playlist/cue/CueParser.cxx
+4
-2
CueParser.hxx
src/playlist/cue/CueParser.hxx
+1
-1
CuePlaylistPlugin.cxx
src/playlist/plugins/CuePlaylistPlugin.cxx
+4
-4
EmbeddedCuePlaylistPlugin.cxx
src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
+4
-4
No files found.
src/playlist/cue/CueParser.cxx
View file @
e2a0fd7a
...
...
@@ -281,7 +281,7 @@ CueParser::Finish()
end
=
true
;
}
DetachedSong
*
std
::
unique_ptr
<
DetachedSong
>
CueParser
::
Get
()
{
if
(
finished
==
nullptr
&&
end
)
{
...
...
@@ -293,5 +293,7 @@ CueParser::Get()
previous
.
reset
();
}
return
finished
.
release
();
auto
result
=
std
::
move
(
finished
);
finished
.
reset
();
return
result
;
}
src/playlist/cue/CueParser.hxx
View file @
e2a0fd7a
...
...
@@ -118,7 +118,7 @@ public:
* @return a song object that must be freed by the caller, or NULL if
* no song was finished at this time
*/
DetachedSong
*
Get
();
std
::
unique_ptr
<
DetachedSong
>
Get
();
private
:
gcc_pure
...
...
src/playlist/plugins/CuePlaylistPlugin.cxx
View file @
e2a0fd7a
...
...
@@ -48,20 +48,20 @@ cue_playlist_open_stream(InputStream &is)
DetachedSong
*
CuePlaylist
::
NextSong
()
{
DetachedSong
*
song
=
parser
.
Get
();
auto
song
=
parser
.
Get
();
if
(
song
!=
nullptr
)
return
song
;
return
song
.
release
()
;
const
char
*
line
;
while
((
line
=
tis
.
ReadLine
())
!=
nullptr
)
{
parser
.
Feed
(
line
);
song
=
parser
.
Get
();
if
(
song
!=
nullptr
)
return
song
;
return
song
.
release
()
;
}
parser
.
Finish
();
return
parser
.
Get
();
return
parser
.
Get
()
.
release
()
;
}
static
const
char
*
const
cue_playlist_suffixes
[]
=
{
...
...
src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
View file @
e2a0fd7a
...
...
@@ -127,10 +127,10 @@ embcue_playlist_open_uri(const char *uri,
DetachedSong
*
EmbeddedCuePlaylist
::
NextSong
()
{
DetachedSong
*
song
=
parser
->
Get
();
auto
song
=
parser
->
Get
();
if
(
song
!=
nullptr
)
{
song
->
SetURI
(
filename
);
return
song
;
return
song
.
release
()
;
}
while
(
*
next
!=
0
)
{
...
...
@@ -149,7 +149,7 @@ EmbeddedCuePlaylist::NextSong()
song
=
parser
->
Get
();
if
(
song
!=
nullptr
)
{
song
->
SetURI
(
filename
);
return
song
;
return
song
.
release
()
;
}
}
...
...
@@ -157,7 +157,7 @@ EmbeddedCuePlaylist::NextSong()
song
=
parser
->
Get
();
if
(
song
!=
nullptr
)
song
->
SetURI
(
filename
);
return
song
;
return
song
.
release
()
;
}
static
const
char
*
const
embcue_playlist_suffixes
[]
=
{
...
...
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