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
7bce6329
Commit
7bce6329
authored
7 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/File, input/Plugin: return InputStreamPtr
parent
49619fbd
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
60 additions
and
63 deletions
+60
-63
TagArchive.cxx
src/TagArchive.cxx
+2
-2
ArchiveFile.hxx
src/archive/ArchiveFile.hxx
+4
-3
Bzip2ArchivePlugin.cxx
src/archive/plugins/Bzip2ArchivePlugin.cxx
+4
-4
Iso9660ArchivePlugin.cxx
src/archive/plugins/Iso9660ArchivePlugin.cxx
+5
-5
ZzipArchivePlugin.cxx
src/archive/plugins/ZzipArchivePlugin.cxx
+6
-6
InputPlugin.hxx
src/input/InputPlugin.hxx
+4
-2
Open.cxx
src/input/Open.cxx
+2
-4
AlsaInputPlugin.cxx
src/input/plugins/AlsaInputPlugin.cxx
+7
-7
ArchiveInputPlugin.cxx
src/input/plugins/ArchiveInputPlugin.cxx
+2
-2
CdioParanoiaInputPlugin.cxx
src/input/plugins/CdioParanoiaInputPlugin.cxx
+5
-4
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+4
-4
FfmpegInputPlugin.cxx
src/input/plugins/FfmpegInputPlugin.cxx
+2
-2
FileInputPlugin.cxx
src/input/plugins/FileInputPlugin.cxx
+4
-4
MmsInputPlugin.cxx
src/input/plugins/MmsInputPlugin.cxx
+2
-2
NfsInputPlugin.cxx
src/input/plugins/NfsInputPlugin.cxx
+3
-9
RewindInputPlugin.cxx
src/input/plugins/RewindInputPlugin.cxx
+1
-1
SmbclientInputPlugin.cxx
src/input/plugins/SmbclientInputPlugin.cxx
+3
-2
No files found.
src/TagArchive.cxx
View file @
7bce6329
...
@@ -31,7 +31,7 @@ try {
...
@@ -31,7 +31,7 @@ try {
Mutex
mutex
;
Mutex
mutex
;
Cond
cond
;
Cond
cond
;
InputStreamPtr
is
(
archive
.
OpenStream
(
path_utf8
,
mutex
,
cond
)
);
auto
is
=
archive
.
OpenStream
(
path_utf8
,
mutex
,
cond
);
if
(
!
is
)
if
(
!
is
)
return
false
;
return
false
;
...
@@ -47,7 +47,7 @@ try {
...
@@ -47,7 +47,7 @@ try {
Mutex
mutex
;
Mutex
mutex
;
Cond
cond
;
Cond
cond
;
InputStreamPtr
is
(
archive
.
OpenStream
(
path_utf8
,
mutex
,
cond
)
);
auto
is
=
archive
.
OpenStream
(
path_utf8
,
mutex
,
cond
);
return
is
&&
tag_stream_scan
(
*
is
,
builder
);
return
is
&&
tag_stream_scan
(
*
is
,
builder
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/archive/ArchiveFile.hxx
View file @
7bce6329
...
@@ -20,10 +20,11 @@
...
@@ -20,10 +20,11 @@
#ifndef MPD_ARCHIVE_FILE_HXX
#ifndef MPD_ARCHIVE_FILE_HXX
#define MPD_ARCHIVE_FILE_HXX
#define MPD_ARCHIVE_FILE_HXX
#include "input/Ptr.hxx"
class
Mutex
;
class
Mutex
;
class
Cond
;
class
Cond
;
class
ArchiveVisitor
;
class
ArchiveVisitor
;
class
InputStream
;
class
ArchiveFile
{
class
ArchiveFile
{
public
:
public
:
...
@@ -41,8 +42,8 @@ public:
...
@@ -41,8 +42,8 @@ public:
*
*
* @param path the path within the archive
* @param path the path within the archive
*/
*/
virtual
InputStream
*
OpenStream
(
const
char
*
path
,
virtual
InputStream
Ptr
OpenStream
(
const
char
*
path
,
Mutex
&
mutex
,
Cond
&
cond
)
=
0
;
Mutex
&
mutex
,
Cond
&
cond
)
=
0
;
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
src/archive/plugins/Bzip2ArchivePlugin.cxx
View file @
7bce6329
...
@@ -53,8 +53,8 @@ public:
...
@@ -53,8 +53,8 @@ public:
visitor
.
VisitArchiveEntry
(
name
.
c_str
());
visitor
.
VisitArchiveEntry
(
name
.
c_str
());
}
}
InputStream
*
OpenStream
(
const
char
*
path
,
InputStream
Ptr
OpenStream
(
const
char
*
path
,
Mutex
&
mutex
,
Cond
&
cond
)
override
;
Mutex
&
mutex
,
Cond
&
cond
)
override
;
};
};
class
Bzip2InputStream
final
:
public
InputStream
{
class
Bzip2InputStream
final
:
public
InputStream
{
...
@@ -127,11 +127,11 @@ Bzip2InputStream::~Bzip2InputStream()
...
@@ -127,11 +127,11 @@ Bzip2InputStream::~Bzip2InputStream()
BZ2_bzDecompressEnd
(
&
bzstream
);
BZ2_bzDecompressEnd
(
&
bzstream
);
}
}
InputStream
*
InputStream
Ptr
Bzip2ArchiveFile
::
OpenStream
(
const
char
*
path
,
Bzip2ArchiveFile
::
OpenStream
(
const
char
*
path
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
return
new
Bzip2InputStream
(
istream
,
path
,
mutex
,
cond
);
return
std
::
make_unique
<
Bzip2InputStream
>
(
istream
,
path
,
mutex
,
cond
);
}
}
inline
bool
inline
bool
...
...
This diff is collapsed.
Click to expand it.
src/archive/plugins/Iso9660ArchivePlugin.cxx
View file @
7bce6329
...
@@ -74,8 +74,8 @@ public:
...
@@ -74,8 +74,8 @@ public:
virtual
void
Visit
(
ArchiveVisitor
&
visitor
)
override
;
virtual
void
Visit
(
ArchiveVisitor
&
visitor
)
override
;
InputStream
*
OpenStream
(
const
char
*
path
,
InputStream
Ptr
OpenStream
(
const
char
*
path
,
Mutex
&
mutex
,
Cond
&
cond
)
override
;
Mutex
&
mutex
,
Cond
&
cond
)
override
;
};
};
/* archive open && listing routine */
/* archive open && listing routine */
...
@@ -156,7 +156,7 @@ public:
...
@@ -156,7 +156,7 @@ public:
size_t
Read
(
void
*
ptr
,
size_t
size
)
override
;
size_t
Read
(
void
*
ptr
,
size_t
size
)
override
;
};
};
InputStream
*
InputStream
Ptr
Iso9660ArchiveFile
::
OpenStream
(
const
char
*
pathname
,
Iso9660ArchiveFile
::
OpenStream
(
const
char
*
pathname
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -165,8 +165,8 @@ Iso9660ArchiveFile::OpenStream(const char *pathname,
...
@@ -165,8 +165,8 @@ Iso9660ArchiveFile::OpenStream(const char *pathname,
throw
FormatRuntimeError
(
"not found in the ISO file: %s"
,
throw
FormatRuntimeError
(
"not found in the ISO file: %s"
,
pathname
);
pathname
);
return
new
Iso9660InputStream
(
iso
,
pathname
,
mutex
,
cond
,
return
std
::
make_unique
<
Iso9660InputStream
>
(
iso
,
pathname
,
mutex
,
cond
,
statbuf
);
statbuf
);
}
}
size_t
size_t
...
...
This diff is collapsed.
Click to expand it.
src/archive/plugins/ZzipArchivePlugin.cxx
View file @
7bce6329
...
@@ -59,8 +59,8 @@ public:
...
@@ -59,8 +59,8 @@ public:
virtual
void
Visit
(
ArchiveVisitor
&
visitor
)
override
;
virtual
void
Visit
(
ArchiveVisitor
&
visitor
)
override
;
InputStream
*
OpenStream
(
const
char
*
path
,
InputStream
Ptr
OpenStream
(
const
char
*
path
,
Mutex
&
mutex
,
Cond
&
cond
)
override
;
Mutex
&
mutex
,
Cond
&
cond
)
override
;
};
};
/* archive open && listing routine */
/* archive open && listing routine */
...
@@ -116,7 +116,7 @@ public:
...
@@ -116,7 +116,7 @@ public:
void
Seek
(
offset_type
offset
)
override
;
void
Seek
(
offset_type
offset
)
override
;
};
};
InputStream
*
InputStream
Ptr
ZzipArchiveFile
::
OpenStream
(
const
char
*
pathname
,
ZzipArchiveFile
::
OpenStream
(
const
char
*
pathname
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -125,9 +125,9 @@ ZzipArchiveFile::OpenStream(const char *pathname,
...
@@ -125,9 +125,9 @@ ZzipArchiveFile::OpenStream(const char *pathname,
throw
FormatRuntimeError
(
"not found in the ZIP file: %s"
,
throw
FormatRuntimeError
(
"not found in the ZIP file: %s"
,
pathname
);
pathname
);
return
new
ZzipInputStream
(
dir
,
pathname
,
return
std
::
make_unique
<
ZzipInputStream
>
(
dir
,
pathname
,
mutex
,
cond
,
mutex
,
cond
,
_file
);
_file
);
}
}
size_t
size_t
...
...
This diff is collapsed.
Click to expand it.
src/input/InputPlugin.hxx
View file @
7bce6329
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#ifndef MPD_INPUT_PLUGIN_HXX
#ifndef MPD_INPUT_PLUGIN_HXX
#define MPD_INPUT_PLUGIN_HXX
#define MPD_INPUT_PLUGIN_HXX
#include "Ptr.hxx"
struct
ConfigBlock
;
struct
ConfigBlock
;
class
Mutex
;
class
Mutex
;
class
Cond
;
class
Cond
;
...
@@ -48,8 +50,8 @@ struct InputPlugin {
...
@@ -48,8 +50,8 @@ struct InputPlugin {
/**
/**
* Throws std::runtime_error on error.
* Throws std::runtime_error on error.
*/
*/
InputStream
*
(
*
open
)(
const
char
*
uri
,
InputStream
Ptr
(
*
open
)(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
);
Mutex
&
mutex
,
Cond
&
cond
);
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
src/input/Open.cxx
View file @
7bce6329
...
@@ -39,11 +39,9 @@ InputStream::Open(const char *url,
...
@@ -39,11 +39,9 @@ InputStream::Open(const char *url,
}
}
input_plugins_for_each_enabled
(
plugin
)
{
input_plugins_for_each_enabled
(
plugin
)
{
InputStream
*
is
;
auto
is
=
plugin
->
open
(
url
,
mutex
,
cond
);
is
=
plugin
->
open
(
url
,
mutex
,
cond
);
if
(
is
!=
nullptr
)
if
(
is
!=
nullptr
)
return
input_rewind_open
(
InputStreamPtr
(
is
));
return
input_rewind_open
(
std
::
move
(
is
));
}
}
throw
std
::
runtime_error
(
"Unrecognized URI"
);
throw
std
::
runtime_error
(
"Unrecognized URI"
);
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/AlsaInputPlugin.cxx
View file @
7bce6329
...
@@ -110,8 +110,8 @@ public:
...
@@ -110,8 +110,8 @@ public:
snd_pcm_close
(
capture_handle
);
snd_pcm_close
(
capture_handle
);
}
}
static
InputStream
*
Create
(
EventLoop
&
event_loop
,
const
char
*
uri
,
static
InputStream
Ptr
Create
(
EventLoop
&
event_loop
,
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
);
Mutex
&
mutex
,
Cond
&
cond
);
protected
:
protected
:
/* virtual methods from AsyncInputStream */
/* virtual methods from AsyncInputStream */
...
@@ -146,7 +146,7 @@ private:
...
@@ -146,7 +146,7 @@ private:
void
DispatchSockets
()
noexcept
override
;
void
DispatchSockets
()
noexcept
override
;
};
};
inline
InputStream
*
inline
InputStream
Ptr
AlsaInputStream
::
Create
(
EventLoop
&
event_loop
,
const
char
*
uri
,
AlsaInputStream
::
Create
(
EventLoop
&
event_loop
,
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -167,9 +167,9 @@ AlsaInputStream::Create(EventLoop &event_loop, const char *uri,
...
@@ -167,9 +167,9 @@ AlsaInputStream::Create(EventLoop &event_loop, const char *uri,
snd_pcm_t
*
handle
=
OpenDevice
(
device
,
rate
,
format
,
channels
);
snd_pcm_t
*
handle
=
OpenDevice
(
device
,
rate
,
format
,
channels
);
int
frame_size
=
snd_pcm_format_width
(
format
)
/
8
*
channels
;
int
frame_size
=
snd_pcm_format_width
(
format
)
/
8
*
channels
;
return
new
AlsaInputStream
(
event_loop
,
return
std
::
make_unique
<
AlsaInputStream
>
(
event_loop
,
uri
,
mutex
,
cond
,
uri
,
mutex
,
cond
,
device
,
handle
,
frame_size
);
device
,
handle
,
frame_size
);
}
}
std
::
chrono
::
steady_clock
::
duration
std
::
chrono
::
steady_clock
::
duration
...
@@ -396,7 +396,7 @@ alsa_input_init(EventLoop &event_loop, const ConfigBlock &)
...
@@ -396,7 +396,7 @@ alsa_input_init(EventLoop &event_loop, const ConfigBlock &)
alsa_input_event_loop
=
&
event_loop
;
alsa_input_event_loop
=
&
event_loop
;
}
}
static
InputStream
*
static
InputStream
Ptr
alsa_input_open
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
alsa_input_open
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
{
{
return
AlsaInputStream
::
Create
(
*
alsa_input_event_loop
,
uri
,
return
AlsaInputStream
::
Create
(
*
alsa_input_event_loop
,
uri
,
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/ArchiveInputPlugin.cxx
View file @
7bce6329
...
@@ -66,10 +66,10 @@ OpenArchiveInputStream(Path path, Mutex &mutex, Cond &cond)
...
@@ -66,10 +66,10 @@ OpenArchiveInputStream(Path path, Mutex &mutex, Cond &cond)
delete
file
;
delete
file
;
};
};
return
InputStreamPtr
(
file
->
OpenStream
(
filename
,
mutex
,
cond
)
);
return
file
->
OpenStream
(
filename
,
mutex
,
cond
);
}
}
static
InputStream
*
static
InputStream
Ptr
input_archive_open
(
gcc_unused
const
char
*
filename
,
input_archive_open
(
gcc_unused
const
char
*
filename
,
gcc_unused
Mutex
&
mutex
,
gcc_unused
Cond
&
cond
)
gcc_unused
Mutex
&
mutex
,
gcc_unused
Cond
&
cond
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/CdioParanoiaInputPlugin.cxx
View file @
7bce6329
...
@@ -182,7 +182,7 @@ cdio_detect_device(void)
...
@@ -182,7 +182,7 @@ cdio_detect_device(void)
return
path
;
return
path
;
}
}
static
InputStream
*
static
InputStream
Ptr
input_cdio_open
(
const
char
*
uri
,
input_cdio_open
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -250,9 +250,10 @@ input_cdio_open(const char *uri,
...
@@ -250,9 +250,10 @@ input_cdio_open(const char *uri,
lsn_to
=
cdio_get_disc_last_lsn
(
cdio
);
lsn_to
=
cdio_get_disc_last_lsn
(
cdio
);
}
}
return
new
CdioParanoiaInputStream
(
uri
,
mutex
,
cond
,
return
std
::
make_unique
<
CdioParanoiaInputStream
>
(
uri
,
mutex
,
cond
,
drv
,
cdio
,
reverse_endian
,
drv
,
cdio
,
lsn_from
,
lsn_to
);
reverse_endian
,
lsn_from
,
lsn_to
);
}
}
void
void
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/CurlInputPlugin.cxx
View file @
7bce6329
...
@@ -88,7 +88,7 @@ struct CurlInputStream final : public AsyncInputStream, CurlResponseHandler {
...
@@ -88,7 +88,7 @@ struct CurlInputStream final : public AsyncInputStream, CurlResponseHandler {
CurlInputStream
(
const
CurlInputStream
&
)
=
delete
;
CurlInputStream
(
const
CurlInputStream
&
)
=
delete
;
CurlInputStream
&
operator
=
(
const
CurlInputStream
&
)
=
delete
;
CurlInputStream
&
operator
=
(
const
CurlInputStream
&
)
=
delete
;
static
InputStream
*
Open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
);
static
InputStream
Ptr
Open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
);
/**
/**
* Create and initialize a new #CurlRequest instance. After
* Create and initialize a new #CurlRequest instance. After
...
@@ -435,7 +435,7 @@ CurlInputStream::DoSeek(offset_type new_offset)
...
@@ -435,7 +435,7 @@ CurlInputStream::DoSeek(offset_type new_offset)
});
});
}
}
inline
InputStream
*
inline
InputStream
Ptr
CurlInputStream
::
Open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
)
CurlInputStream
::
Open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
)
{
{
auto
c
=
std
::
make_unique
<
CurlInputStream
>
((
*
curl_init
)
->
GetEventLoop
(),
auto
c
=
std
::
make_unique
<
CurlInputStream
>
((
*
curl_init
)
->
GetEventLoop
(),
...
@@ -447,10 +447,10 @@ CurlInputStream::Open(const char *url, Mutex &mutex, Cond &cond)
...
@@ -447,10 +447,10 @@ CurlInputStream::Open(const char *url, Mutex &mutex, Cond &cond)
});
});
auto
icy
=
c
->
icy
;
auto
icy
=
c
->
icy
;
return
new
IcyInputStream
(
std
::
move
(
c
),
std
::
move
(
icy
));
return
std
::
make_unique
<
IcyInputStream
>
(
std
::
move
(
c
),
std
::
move
(
icy
));
}
}
static
InputStream
*
static
InputStream
Ptr
input_curl_open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
)
input_curl_open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
)
{
{
if
(
strncmp
(
url
,
"http://"
,
7
)
!=
0
&&
if
(
strncmp
(
url
,
"http://"
,
7
)
!=
0
&&
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/FfmpegInputPlugin.cxx
View file @
7bce6329
...
@@ -81,7 +81,7 @@ input_ffmpeg_init(EventLoop &, const ConfigBlock &)
...
@@ -81,7 +81,7 @@ input_ffmpeg_init(EventLoop &, const ConfigBlock &)
throw
PluginUnavailable
(
"No protocol"
);
throw
PluginUnavailable
(
"No protocol"
);
}
}
static
InputStream
*
static
InputStream
Ptr
input_ffmpeg_open
(
const
char
*
uri
,
input_ffmpeg_open
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -98,7 +98,7 @@ input_ffmpeg_open(const char *uri,
...
@@ -98,7 +98,7 @@ input_ffmpeg_open(const char *uri,
if
(
result
!=
0
)
if
(
result
!=
0
)
throw
MakeFfmpegError
(
result
);
throw
MakeFfmpegError
(
result
);
return
new
FfmpegInputStream
(
uri
,
mutex
,
cond
,
h
);
return
std
::
make_unique
<
FfmpegInputStream
>
(
uri
,
mutex
,
cond
,
h
);
}
}
size_t
size_t
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/FileInputPlugin.cxx
View file @
7bce6329
...
@@ -70,12 +70,12 @@ OpenFileInputStream(Path path,
...
@@ -70,12 +70,12 @@ OpenFileInputStream(Path path,
POSIX_FADV_SEQUENTIAL
);
POSIX_FADV_SEQUENTIAL
);
#endif
#endif
return
InputStreamPtr
(
new
FileInputStream
(
path
.
ToUTF8
().
c_str
(),
return
std
::
make_unique
<
FileInputStream
>
(
path
.
ToUTF8
().
c_str
(),
std
::
move
(
reader
),
info
.
GetSize
(),
std
::
move
(
reader
),
info
.
GetSize
(),
mutex
,
cond
)
);
mutex
,
cond
);
}
}
static
InputStream
*
static
InputStream
Ptr
input_file_open
(
gcc_unused
const
char
*
filename
,
input_file_open
(
gcc_unused
const
char
*
filename
,
gcc_unused
Mutex
&
mutex
,
gcc_unused
Cond
&
cond
)
gcc_unused
Mutex
&
mutex
,
gcc_unused
Cond
&
cond
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/MmsInputPlugin.cxx
View file @
7bce6329
...
@@ -66,7 +66,7 @@ MmsInputStream::Open()
...
@@ -66,7 +66,7 @@ MmsInputStream::Open()
SetMimeType
(
"audio/x-ms-wma"
);
SetMimeType
(
"audio/x-ms-wma"
);
}
}
static
InputStream
*
static
InputStream
Ptr
input_mms_open
(
const
char
*
url
,
input_mms_open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -76,7 +76,7 @@ input_mms_open(const char *url,
...
@@ -76,7 +76,7 @@ input_mms_open(const char *url,
!
StringStartsWith
(
url
,
"mmsu://"
))
!
StringStartsWith
(
url
,
"mmsu://"
))
return
nullptr
;
return
nullptr
;
auto
m
=
new
MmsInputStream
(
url
,
mutex
,
cond
);
auto
m
=
std
::
make_unique
<
MmsInputStream
>
(
url
,
mutex
,
cond
);
m
->
Start
();
m
->
Start
();
return
m
;
return
m
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/NfsInputPlugin.cxx
View file @
7bce6329
...
@@ -216,21 +216,15 @@ input_nfs_finish() noexcept
...
@@ -216,21 +216,15 @@ input_nfs_finish() noexcept
nfs_finish
();
nfs_finish
();
}
}
static
InputStream
*
static
InputStream
Ptr
input_nfs_open
(
const
char
*
uri
,
input_nfs_open
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
if
(
!
StringStartsWith
(
uri
,
"nfs://"
))
if
(
!
StringStartsWith
(
uri
,
"nfs://"
))
return
nullptr
;
return
nullptr
;
NfsInputStream
*
is
=
new
NfsInputStream
(
uri
,
mutex
,
cond
);
auto
is
=
std
::
make_unique
<
NfsInputStream
>
(
uri
,
mutex
,
cond
);
try
{
is
->
Open
();
is
->
Open
();
}
catch
(...)
{
delete
is
;
throw
;
}
return
is
;
return
is
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/RewindInputPlugin.cxx
View file @
7bce6329
...
@@ -147,5 +147,5 @@ input_rewind_open(InputStreamPtr is)
...
@@ -147,5 +147,5 @@ input_rewind_open(InputStreamPtr is)
/* seekable resources don't need this plugin */
/* seekable resources don't need this plugin */
return
is
;
return
is
;
return
InputStreamPtr
(
new
RewindInputStream
(
std
::
move
(
is
)
));
return
std
::
make_unique
<
RewindInputStream
>
(
std
::
move
(
is
));
}
}
This diff is collapsed.
Click to expand it.
src/input/plugins/SmbclientInputPlugin.cxx
View file @
7bce6329
...
@@ -83,7 +83,7 @@ input_smbclient_init(EventLoop &, const ConfigBlock &)
...
@@ -83,7 +83,7 @@ input_smbclient_init(EventLoop &, const ConfigBlock &)
// TODO: evaluate ConfigBlock, call smbc_setOption*()
// TODO: evaluate ConfigBlock, call smbc_setOption*()
}
}
static
InputStream
*
static
InputStream
Ptr
input_smbclient_open
(
const
char
*
uri
,
input_smbclient_open
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
Mutex
&
mutex
,
Cond
&
cond
)
{
{
...
@@ -119,7 +119,8 @@ input_smbclient_open(const char *uri,
...
@@ -119,7 +119,8 @@ input_smbclient_open(const char *uri,
throw
MakeErrno
(
e
,
"smbc_fstat() failed"
);
throw
MakeErrno
(
e
,
"smbc_fstat() failed"
);
}
}
return
new
SmbclientInputStream
(
uri
,
mutex
,
cond
,
ctx
,
fd
,
st
);
return
std
::
make_unique
<
SmbclientInputStream
>
(
uri
,
mutex
,
cond
,
ctx
,
fd
,
st
);
}
}
size_t
size_t
...
...
This diff is collapsed.
Click to expand it.
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