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
0705f42c
Commit
0705f42c
authored
Feb 21, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/Plugin: pass InputStreamPtr&& to open_stream()
Obsolete class CloseSongEnumerator, which was a kludge.
parent
cadc67ea
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
97 additions
and
157 deletions
+97
-157
Makefile.am
Makefile.am
+0
-2
TextInputStream.cxx
src/input/TextInputStream.cxx
+6
-1
TextInputStream.hxx
src/input/TextInputStream.hxx
+8
-3
CloseSongEnumerator.cxx
src/playlist/CloseSongEnumerator.cxx
+0
-35
CloseSongEnumerator.hxx
src/playlist/CloseSongEnumerator.hxx
+0
-47
PlaylistPlugin.hxx
src/playlist/PlaylistPlugin.hxx
+8
-4
PlaylistRegistry.cxx
src/playlist/PlaylistRegistry.cxx
+18
-14
PlaylistRegistry.hxx
src/playlist/PlaylistRegistry.hxx
+4
-3
PlaylistStream.cxx
src/playlist/PlaylistStream.cxx
+3
-12
AsxPlaylistPlugin.cxx
src/playlist/plugins/AsxPlaylistPlugin.cxx
+2
-2
CuePlaylistPlugin.cxx
src/playlist/plugins/CuePlaylistPlugin.cxx
+4
-5
ExtM3uPlaylistPlugin.cxx
src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
+17
-8
M3uPlaylistPlugin.cxx
src/playlist/plugins/M3uPlaylistPlugin.cxx
+4
-4
PlsPlaylistPlugin.cxx
src/playlist/plugins/PlsPlaylistPlugin.cxx
+11
-5
RssPlaylistPlugin.cxx
src/playlist/plugins/RssPlaylistPlugin.cxx
+2
-2
XspfPlaylistPlugin.cxx
src/playlist/plugins/XspfPlaylistPlugin.cxx
+2
-2
dump_playlist.cxx
test/dump_playlist.cxx
+1
-1
dump_text_file.cxx
test/dump_text_file.cxx
+7
-7
No files found.
Makefile.am
View file @
0705f42c
...
...
@@ -1468,8 +1468,6 @@ endif
libplaylist_plugins_a_SOURCES
=
\
src/playlist/PlaylistPlugin.hxx
\
src/playlist/SongEnumerator.hxx
\
src/playlist/CloseSongEnumerator.cxx
\
src/playlist/CloseSongEnumerator.hxx
\
src/playlist/MemorySongEnumerator.cxx
\
src/playlist/MemorySongEnumerator.hxx
\
src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
\
...
...
src/input/TextInputStream.cxx
View file @
0705f42c
...
...
@@ -26,6 +26,11 @@
#include <assert.h>
TextInputStream
::
TextInputStream
(
InputStreamPtr
&&
_is
)
:
is
(
std
::
move
(
_is
))
{}
TextInputStream
::~
TextInputStream
()
{}
char
*
TextInputStream
::
ReadLine
()
{
...
...
@@ -54,7 +59,7 @@ TextInputStream::ReadLine()
--
dest
.
size
;
Error
error
;
size_t
nbytes
=
is
.
LockRead
(
dest
.
data
,
dest
.
size
,
error
);
size_t
nbytes
=
is
->
LockRead
(
dest
.
data
,
dest
.
size
,
error
);
if
(
nbytes
>
0
)
buffer
.
Append
(
nbytes
);
else
if
(
error
.
IsDefined
())
{
...
...
src/input/TextInputStream.hxx
View file @
0705f42c
...
...
@@ -20,12 +20,13 @@
#ifndef MPD_TEXT_INPUT_STREAM_HXX
#define MPD_TEXT_INPUT_STREAM_HXX
#include "input/Ptr.hxx"
#include "util/StaticFifoBuffer.hxx"
class
InputStream
;
class
TextInputStream
{
InputStream
&
is
;
InputStream
Ptr
is
;
StaticFifoBuffer
<
char
,
4096
>
buffer
;
public
:
...
...
@@ -35,12 +36,16 @@ public:
*
* @param _is an open #InputStream object
*/
explicit
TextInputStream
(
InputStream
&
_is
)
:
is
(
_is
)
{}
explicit
TextInputStream
(
InputStream
Ptr
&&
_is
);
~
TextInputStream
();
TextInputStream
(
const
TextInputStream
&
)
=
delete
;
TextInputStream
&
operator
=
(
const
TextInputStream
&
)
=
delete
;
InputStreamPtr
&&
StealInputStream
()
{
return
std
::
move
(
is
);
}
/**
* Reads the next line from the stream with newline character stripped.
*
...
...
src/playlist/CloseSongEnumerator.cxx
deleted
100644 → 0
View file @
cadc67ea
/*
* Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "CloseSongEnumerator.hxx"
#include "input/InputStream.hxx"
#include "DetachedSong.hxx"
CloseSongEnumerator
::~
CloseSongEnumerator
()
{
delete
other
;
delete
is
;
}
std
::
unique_ptr
<
DetachedSong
>
CloseSongEnumerator
::
NextSong
()
{
return
other
->
NextSong
();
}
src/playlist/CloseSongEnumerator.hxx
deleted
100644 → 0
View file @
cadc67ea
/*
* Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_CLOSE_SONG_ENUMERATOR_HXX
#define MPD_CLOSE_SONG_ENUMERATOR_HXX
#include "SongEnumerator.hxx"
#include "Compiler.h"
class
InputStream
;
/**
* A #SongEnumerator wrapper that closes an #InputStream automatically
* after deleting the #SongEnumerator
*/
class
CloseSongEnumerator
final
:
public
SongEnumerator
{
SongEnumerator
*
const
other
;
InputStream
*
const
is
;
public
:
gcc_nonnull_all
CloseSongEnumerator
(
SongEnumerator
*
_other
,
InputStream
*
const
_is
)
:
other
(
_other
),
is
(
_is
)
{}
virtual
~
CloseSongEnumerator
();
virtual
std
::
unique_ptr
<
DetachedSong
>
NextSong
()
override
;
};
#endif
src/playlist/PlaylistPlugin.hxx
View file @
0705f42c
...
...
@@ -20,8 +20,9 @@
#ifndef MPD_PLAYLIST_PLUGIN_HXX
#define MPD_PLAYLIST_PLUGIN_HXX
#include "input/Ptr.hxx"
struct
ConfigBlock
;
class
InputStream
;
struct
Tag
;
class
Mutex
;
class
Cond
;
...
...
@@ -57,8 +58,11 @@ struct playlist_plugin {
* Opens the playlist in the specified input stream. It has
* either matched one of the suffixes or one of the MIME
* types.
*
* @parm is the input stream; the pointer will not be
* invalidated when the function returns nullptr
*/
SongEnumerator
*
(
*
open_stream
)(
InputStream
&
is
);
SongEnumerator
*
(
*
open_stream
)(
InputStream
Ptr
&
&
is
);
const
char
*
const
*
schemes
;
const
char
*
const
*
suffixes
;
...
...
@@ -101,9 +105,9 @@ playlist_plugin_open_uri(const struct playlist_plugin *plugin, const char *uri,
static
inline
SongEnumerator
*
playlist_plugin_open_stream
(
const
struct
playlist_plugin
*
plugin
,
InputStream
&
is
)
InputStream
Ptr
&
&
is
)
{
return
plugin
->
open_stream
(
is
);
return
plugin
->
open_stream
(
std
::
move
(
is
)
);
}
#endif
src/playlist/PlaylistRegistry.cxx
View file @
0705f42c
...
...
@@ -183,7 +183,7 @@ playlist_list_open_uri(const char *uri, Mutex &mutex, Cond &cond)
}
static
SongEnumerator
*
playlist_list_open_stream_mime2
(
InputStream
&
is
,
const
char
*
mime
)
playlist_list_open_stream_mime2
(
InputStream
Ptr
&
&
is
,
const
char
*
mime
)
{
assert
(
mime
!=
nullptr
);
...
...
@@ -193,10 +193,10 @@ playlist_list_open_stream_mime2(InputStream &is, const char *mime)
string_array_contains
(
plugin
->
mime_types
,
mime
))
{
/* rewind the stream, so each plugin gets a
fresh start */
is
.
Rewind
(
IgnoreError
());
is
->
Rewind
(
IgnoreError
());
auto
playlist
=
playlist_plugin_open_stream
(
plugin
,
is
);
std
::
move
(
is
)
);
if
(
playlist
!=
nullptr
)
return
playlist
;
}
...
...
@@ -206,24 +206,25 @@ playlist_list_open_stream_mime2(InputStream &is, const char *mime)
}
static
SongEnumerator
*
playlist_list_open_stream_mime
(
InputStream
&
is
,
const
char
*
full_mime
)
playlist_list_open_stream_mime
(
InputStream
Ptr
&
&
is
,
const
char
*
full_mime
)
{
assert
(
full_mime
!=
nullptr
);
const
char
*
semicolon
=
strchr
(
full_mime
,
';'
);
if
(
semicolon
==
nullptr
)
return
playlist_list_open_stream_mime2
(
is
,
full_mime
);
return
playlist_list_open_stream_mime2
(
std
::
move
(
is
),
full_mime
);
if
(
semicolon
==
full_mime
)
return
nullptr
;
/* probe only the portion before the semicolon*/
const
std
::
string
mime
(
full_mime
,
semicolon
);
return
playlist_list_open_stream_mime2
(
is
,
mime
.
c_str
());
return
playlist_list_open_stream_mime2
(
std
::
move
(
is
)
,
mime
.
c_str
());
}
SongEnumerator
*
playlist_list_open_stream_suffix
(
InputStream
&
is
,
const
char
*
suffix
)
playlist_list_open_stream_suffix
(
InputStream
Ptr
&
&
is
,
const
char
*
suffix
)
{
assert
(
suffix
!=
nullptr
);
...
...
@@ -233,9 +234,10 @@ playlist_list_open_stream_suffix(InputStream &is, const char *suffix)
string_array_contains
(
plugin
->
suffixes
,
suffix
))
{
/* rewind the stream, so each plugin gets a
fresh start */
is
.
Rewind
(
IgnoreError
());
is
->
Rewind
(
IgnoreError
());
auto
playlist
=
playlist_plugin_open_stream
(
plugin
,
is
);
auto
playlist
=
playlist_plugin_open_stream
(
plugin
,
std
::
move
(
is
));
if
(
playlist
!=
nullptr
)
return
playlist
;
}
...
...
@@ -245,13 +247,14 @@ playlist_list_open_stream_suffix(InputStream &is, const char *suffix)
}
SongEnumerator
*
playlist_list_open_stream
(
InputStream
&
is
,
const
char
*
uri
)
playlist_list_open_stream
(
InputStream
Ptr
&
&
is
,
const
char
*
uri
)
{
assert
(
is
.
IsReady
());
assert
(
is
->
IsReady
());
const
char
*
const
mime
=
is
.
GetMimeType
();
const
char
*
const
mime
=
is
->
GetMimeType
();
if
(
mime
!=
nullptr
)
{
auto
playlist
=
playlist_list_open_stream_mime
(
is
,
mime
);
auto
playlist
=
playlist_list_open_stream_mime
(
std
::
move
(
is
),
mime
);
if
(
playlist
!=
nullptr
)
return
playlist
;
}
...
...
@@ -261,7 +264,8 @@ playlist_list_open_stream(InputStream &is, const char *uri)
?
uri_get_suffix
(
uri
,
suffix_buffer
)
:
nullptr
;
if
(
suffix
!=
nullptr
)
{
auto
playlist
=
playlist_list_open_stream_suffix
(
is
,
suffix
);
auto
playlist
=
playlist_list_open_stream_suffix
(
std
::
move
(
is
),
suffix
);
if
(
playlist
!=
nullptr
)
return
playlist
;
}
...
...
src/playlist/PlaylistRegistry.hxx
View file @
0705f42c
...
...
@@ -20,10 +20,11 @@
#ifndef MPD_PLAYLIST_REGISTRY_HXX
#define MPD_PLAYLIST_REGISTRY_HXX
#include "input/Ptr.hxx"
class
Mutex
;
class
Cond
;
class
SongEnumerator
;
class
InputStream
;
extern
const
struct
playlist_plugin
*
const
playlist_plugins
[];
...
...
@@ -52,7 +53,7 @@ SongEnumerator *
playlist_list_open_uri
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
);
SongEnumerator
*
playlist_list_open_stream_suffix
(
InputStream
&
is
,
const
char
*
suffix
);
playlist_list_open_stream_suffix
(
InputStream
Ptr
&
&
is
,
const
char
*
suffix
);
/**
* Opens a playlist from an input stream.
...
...
@@ -62,7 +63,7 @@ playlist_list_open_stream_suffix(InputStream &is, const char *suffix);
* used to select the appropriate playlist plugin
*/
SongEnumerator
*
playlist_list_open_stream
(
InputStream
&
is
,
const
char
*
uri
);
playlist_list_open_stream
(
InputStream
Ptr
&
&
is
,
const
char
*
uri
);
/**
* Determines if there is a playlist plugin which can handle the
...
...
src/playlist/PlaylistStream.cxx
View file @
0705f42c
...
...
@@ -20,7 +20,6 @@
#include "config.h"
#include "PlaylistStream.hxx"
#include "PlaylistRegistry.hxx"
#include "CloseSongEnumerator.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "input/InputStream.hxx"
...
...
@@ -50,12 +49,8 @@ try {
return
nullptr
;
}
auto
playlist
=
playlist_list_open_stream_suffix
(
*
is
,
suffix_utf8
.
c_str
());
if
(
playlist
!=
nullptr
)
playlist
=
new
CloseSongEnumerator
(
playlist
,
is
.
release
());
return
playlist
;
return
playlist_list_open_stream_suffix
(
std
::
move
(
is
),
suffix_utf8
.
c_str
());
}
catch
(
const
std
::
runtime_error
&
e
)
{
LogError
(
e
);
return
nullptr
;
...
...
@@ -97,11 +92,7 @@ try {
return
nullptr
;
}
playlist
=
playlist_list_open_stream
(
*
is
,
uri
);
if
(
playlist
==
nullptr
)
return
nullptr
;
return
new
CloseSongEnumerator
(
playlist
,
is
.
release
());
return
playlist_list_open_stream
(
std
::
move
(
is
),
uri
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
LogError
(
e
);
return
nullptr
;
...
...
src/playlist/plugins/AsxPlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -144,7 +144,7 @@ asx_char_data(void *user_data, const XML_Char *s, int len)
*/
static
SongEnumerator
*
asx_open_stream
(
InputStream
&
is
)
asx_open_stream
(
InputStream
Ptr
&
&
is
)
{
AsxParser
parser
;
...
...
@@ -154,7 +154,7 @@ asx_open_stream(InputStream &is)
expat
.
SetCharacterDataHandler
(
asx_char_data
);
Error
error
;
if
(
!
expat
.
Parse
(
is
,
error
))
{
if
(
!
expat
.
Parse
(
*
is
,
error
))
{
LogError
(
error
);
return
nullptr
;
}
...
...
src/playlist/plugins/CuePlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -27,22 +27,21 @@
#include <string>
class
CuePlaylist
final
:
public
SongEnumerator
{
InputStream
&
is
;
TextInputStream
tis
;
CueParser
parser
;
public
:
CuePlaylist
(
InputStream
&
_
is
)
:
is
(
_is
),
tis
(
is
)
{
CuePlaylist
(
InputStream
Ptr
&&
is
)
:
tis
(
std
::
move
(
is
)
)
{
}
virtual
std
::
unique_ptr
<
DetachedSong
>
NextSong
()
override
;
};
static
SongEnumerator
*
cue_playlist_open_stream
(
InputStream
&
is
)
cue_playlist_open_stream
(
InputStream
Ptr
&
&
is
)
{
return
new
CuePlaylist
(
is
);
return
new
CuePlaylist
(
std
::
move
(
is
)
);
}
std
::
unique_ptr
<
DetachedSong
>
...
...
src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -27,6 +27,7 @@
#include "util/StringUtil.hxx"
#include "util/StringCompare.hxx"
#include "input/TextInputStream.hxx"
#include "input/InputStream.hxx"
#include <string.h>
#include <stdlib.h>
...
...
@@ -35,28 +36,36 @@ class ExtM3uPlaylist final : public SongEnumerator {
TextInputStream
tis
;
public
:
ExtM3uPlaylist
(
InputStream
&
is
)
:
tis
(
is
)
{
ExtM3uPlaylist
(
InputStream
Ptr
&
&
is
)
:
tis
(
std
::
move
(
is
)
)
{
}
bool
CheckFirstLine
()
{
/**
* @return nullptr if ExtM3U was recognized, or the original
* InputStream on error
*/
InputStreamPtr
CheckFirstLine
()
{
char
*
line
=
tis
.
ReadLine
();
if
(
line
==
nullptr
)
return
false
;
return
tis
.
StealInputStream
()
;
StripRight
(
line
);
return
strcmp
(
line
,
"#EXTM3U"
)
==
0
;
if
(
strcmp
(
line
,
"#EXTM3U"
)
!=
0
)
return
tis
.
StealInputStream
();
return
nullptr
;
}
virtual
std
::
unique_ptr
<
DetachedSong
>
NextSong
()
override
;
};
static
SongEnumerator
*
extm3u_open_stream
(
InputStream
&
is
)
extm3u_open_stream
(
InputStream
Ptr
&
&
is
)
{
ExtM3uPlaylist
*
playlist
=
new
ExtM3uPlaylist
(
is
);
ExtM3uPlaylist
*
playlist
=
new
ExtM3uPlaylist
(
std
::
move
(
is
)
);
if
(
!
playlist
->
CheckFirstLine
())
{
is
=
playlist
->
CheckFirstLine
();
if
(
is
)
{
/* no EXTM3U header: fall back to the plain m3u
plugin */
delete
playlist
;
...
...
src/playlist/plugins/M3uPlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -29,17 +29,17 @@ class M3uPlaylist final : public SongEnumerator {
TextInputStream
tis
;
public
:
M3uPlaylist
(
InputStream
&
is
)
:
tis
(
is
)
{
M3uPlaylist
(
InputStream
Ptr
&
&
is
)
:
tis
(
std
::
move
(
is
)
)
{
}
virtual
std
::
unique_ptr
<
DetachedSong
>
NextSong
()
override
;
};
static
SongEnumerator
*
m3u_open_stream
(
InputStream
&
is
)
m3u_open_stream
(
InputStream
Ptr
&
&
is
)
{
return
new
M3uPlaylist
(
is
);
return
new
M3uPlaylist
(
std
::
move
(
is
)
);
}
std
::
unique_ptr
<
DetachedSong
>
...
...
src/playlist/plugins/PlsPlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -22,6 +22,7 @@
#include "../PlaylistPlugin.hxx"
#include "../MemorySongEnumerator.hxx"
#include "input/TextInputStream.hxx"
#include "input/InputStream.hxx"
#include "DetachedSong.hxx"
#include "tag/TagBuilder.hxx"
#include "util/ASCII.hxx"
...
...
@@ -142,17 +143,22 @@ ParsePls(TextInputStream &is, std::forward_list<DetachedSong> &songs)
}
static
bool
ParsePls
(
InputStream
&
is
,
std
::
forward_list
<
DetachedSong
>
&
songs
)
ParsePls
(
InputStream
Ptr
&
&
is
,
std
::
forward_list
<
DetachedSong
>
&
songs
)
{
TextInputStream
tis
(
is
);
return
ParsePls
(
tis
,
songs
);
TextInputStream
tis
(
std
::
move
(
is
));
if
(
!
ParsePls
(
tis
,
songs
))
{
is
=
tis
.
StealInputStream
();
return
false
;
}
return
true
;
}
static
SongEnumerator
*
pls_open_stream
(
InputStream
&
is
)
pls_open_stream
(
InputStream
Ptr
&
&
is
)
{
std
::
forward_list
<
DetachedSong
>
songs
;
if
(
!
ParsePls
(
is
,
songs
))
if
(
!
ParsePls
(
std
::
move
(
is
)
,
songs
))
return
nullptr
;
return
new
MemorySongEnumerator
(
std
::
move
(
songs
));
...
...
src/playlist/plugins/RssPlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -142,7 +142,7 @@ rss_char_data(void *user_data, const XML_Char *s, int len)
*/
static
SongEnumerator
*
rss_open_stream
(
InputStream
&
is
)
rss_open_stream
(
InputStream
Ptr
&
&
is
)
{
RssParser
parser
;
...
...
@@ -152,7 +152,7 @@ rss_open_stream(InputStream &is)
expat
.
SetCharacterDataHandler
(
rss_char_data
);
Error
error
;
if
(
!
expat
.
Parse
(
is
,
error
))
{
if
(
!
expat
.
Parse
(
*
is
,
error
))
{
LogError
(
error
);
return
nullptr
;
}
...
...
src/playlist/plugins/XspfPlaylistPlugin.cxx
View file @
0705f42c
...
...
@@ -189,7 +189,7 @@ xspf_char_data(void *user_data, const XML_Char *s, int len)
*/
static
SongEnumerator
*
xspf_open_stream
(
InputStream
&
is
)
xspf_open_stream
(
InputStream
Ptr
&
&
is
)
{
XspfParser
parser
;
...
...
@@ -199,7 +199,7 @@ xspf_open_stream(InputStream &is)
expat
.
SetCharacterDataHandler
(
xspf_char_data
);
Error
error
;
if
(
!
expat
.
Parse
(
is
,
error
))
{
if
(
!
expat
.
Parse
(
*
is
,
error
))
{
LogError
(
error
);
return
nullptr
;
}
...
...
test/dump_playlist.cxx
View file @
0705f42c
...
...
@@ -98,7 +98,7 @@ try {
/* open the playlist */
playlist
=
playlist_list_open_stream
(
*
is
,
uri
);
playlist
=
playlist_list_open_stream
(
std
::
move
(
is
)
,
uri
);
if
(
playlist
==
NULL
)
{
fprintf
(
stderr
,
"Failed to open playlist
\n
"
);
return
2
;
...
...
test/dump_text_file.cxx
View file @
0705f42c
...
...
@@ -44,23 +44,23 @@ dump_text_file(TextInputStream &is)
}
static
int
dump_input_stream
(
InputStream
&
is
)
dump_input_stream
(
InputStream
Ptr
&
&
is
)
{
{
TextInputStream
tis
(
is
);
TextInputStream
tis
(
std
::
move
(
is
)
);
dump_text_file
(
tis
);
}
is
.
Lock
();
is
->
Lock
();
Error
error
;
if
(
!
is
.
Check
(
error
))
{
if
(
!
is
->
Check
(
error
))
{
LogError
(
error
);
is
.
Unlock
();
is
->
Unlock
();
return
EXIT_FAILURE
;
}
is
.
Unlock
();
is
->
Unlock
();
return
0
;
}
...
...
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
auto
is
=
InputStream
::
OpenReady
(
argv
[
1
],
mutex
,
cond
,
error
);
if
(
is
)
{
ret
=
dump_input_stream
(
*
is
);
ret
=
dump_input_stream
(
std
::
move
(
is
)
);
}
else
{
if
(
error
.
IsDefined
())
LogError
(
error
);
...
...
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