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
38542116
Commit
38542116
authored
Jan 25, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/Plugin: pass EventLoop& to init()
Eliminate dependency on io_thread_get().
parent
58ac72f7
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
21 additions
and
20 deletions
+21
-20
Main.cxx
src/Main.cxx
+1
-1
Init.cxx
src/input/Init.cxx
+2
-2
Init.hxx
src/input/Init.hxx
+3
-1
InputPlugin.hxx
src/input/InputPlugin.hxx
+2
-1
CdioParanoiaInputPlugin.cxx
src/input/plugins/CdioParanoiaInputPlugin.cxx
+1
-1
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+2
-3
FfmpegInputPlugin.cxx
src/input/plugins/FfmpegInputPlugin.cxx
+1
-1
NfsInputPlugin.cxx
src/input/plugins/NfsInputPlugin.cxx
+2
-3
SmbclientInputPlugin.cxx
src/input/plugins/SmbclientInputPlugin.cxx
+1
-1
dump_playlist.cxx
test/dump_playlist.cxx
+1
-1
dump_text_file.cxx
test/dump_text_file.cxx
+1
-1
read_tags.cxx
test/read_tags.cxx
+1
-1
run_decoder.cxx
test/run_decoder.cxx
+1
-1
run_input.cxx
test/run_input.cxx
+1
-1
visit_archive.cxx
test/visit_archive.cxx
+1
-1
No files found.
src/Main.cxx
View file @
38542116
...
...
@@ -525,7 +525,7 @@ try {
instance
->
partition
->
UpdateEffectiveReplayGainMode
();
client_manager_init
();
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
playlist_list_global_init
();
#ifdef ENABLE_DAEMON
...
...
src/input/Init.cxx
View file @
38542116
...
...
@@ -33,7 +33,7 @@
#include <assert.h>
void
input_stream_global_init
()
input_stream_global_init
(
EventLoop
&
event_loop
)
{
const
ConfigBlock
empty
;
...
...
@@ -55,7 +55,7 @@ input_stream_global_init()
try
{
if
(
plugin
->
init
!=
nullptr
)
plugin
->
init
(
*
block
);
plugin
->
init
(
event_loop
,
*
block
);
input_plugins_enabled
[
i
]
=
true
;
}
catch
(
const
PluginUnavailable
&
e
)
{
FormatError
(
e
,
...
...
src/input/Init.hxx
View file @
38542116
...
...
@@ -20,11 +20,13 @@
#ifndef MPD_INPUT_INIT_HXX
#define MPD_INPUT_INIT_HXX
class
EventLoop
;
/**
* Initializes this library and all #InputStream implementations.
*/
void
input_stream_global_init
();
input_stream_global_init
(
EventLoop
&
event_loop
);
/**
* Deinitializes this library and all #InputStream implementations.
...
...
src/input/InputPlugin.hxx
View file @
38542116
...
...
@@ -31,6 +31,7 @@
struct
ConfigBlock
;
class
Mutex
;
class
Cond
;
class
EventLoop
;
class
InputStream
;
struct
InputPlugin
{
...
...
@@ -44,7 +45,7 @@ struct InputPlugin {
*
* Throws std::runtime_error on (fatal) error.
*/
void
(
*
init
)(
const
ConfigBlock
&
block
);
void
(
*
init
)(
EventLoop
&
event_loop
,
const
ConfigBlock
&
block
);
/**
* Global deinitialization. Called once before MPD shuts
...
...
src/input/plugins/CdioParanoiaInputPlugin.cxx
View file @
38542116
...
...
@@ -106,7 +106,7 @@ static constexpr Domain cdio_domain("cdio");
static
bool
default_reverse_endian
;
static
void
input_cdio_init
(
const
ConfigBlock
&
block
)
input_cdio_init
(
EventLoop
&
,
const
ConfigBlock
&
block
)
{
const
char
*
value
=
block
.
GetBlockValue
(
"default_byte_order"
);
if
(
value
!=
nullptr
)
{
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
38542116
...
...
@@ -32,7 +32,6 @@
#include "tag/TagBuilder.hxx"
#include "event/Call.hxx"
#include "event/Loop.hxx"
#include "IOThread.hxx"
#include "thread/Cond.hxx"
#include "util/ASCII.hxx"
#include "util/StringUtil.hxx"
...
...
@@ -285,7 +284,7 @@ CurlInputStream::OnError(std::exception_ptr e)
*/
static
void
input_curl_init
(
const
ConfigBlock
&
block
)
input_curl_init
(
EventLoop
&
event_loop
,
const
ConfigBlock
&
block
)
{
CURLcode
code
=
curl_global_init
(
CURL_GLOBAL_ALL
);
if
(
code
!=
CURLE_OK
)
...
...
@@ -319,7 +318,7 @@ input_curl_init(const ConfigBlock &block)
verify_host
=
block
.
GetBlockValue
(
"verify_host"
,
true
);
try
{
curl_global
=
new
CurlGlobal
(
io_thread_get
()
);
curl_global
=
new
CurlGlobal
(
event_loop
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
LogError
(
e
);
curl_slist_free_all
(
http_200_aliases
);
...
...
src/input/plugins/FfmpegInputPlugin.cxx
View file @
38542116
...
...
@@ -72,7 +72,7 @@ input_ffmpeg_supported(void)
}
static
void
input_ffmpeg_init
(
gcc_unused
const
ConfigBlock
&
block
)
input_ffmpeg_init
(
EventLoop
&
,
const
ConfigBlock
&
)
{
FfmpegInit
();
...
...
src/input/plugins/NfsInputPlugin.cxx
View file @
38542116
...
...
@@ -25,7 +25,6 @@
#include "lib/nfs/FileReader.hxx"
#include "thread/Cond.hxx"
#include "util/StringCompare.hxx"
#include "IOThread.hxx"
#include <string.h>
...
...
@@ -206,9 +205,9 @@ NfsInputStream::OnNfsFileError(std::exception_ptr &&e)
*/
static
void
input_nfs_init
(
const
ConfigBlock
&
)
input_nfs_init
(
EventLoop
&
event_loop
,
const
ConfigBlock
&
)
{
nfs_init
(
io_thread_get
()
);
nfs_init
(
event_loop
);
}
static
void
...
...
src/input/plugins/SmbclientInputPlugin.cxx
View file @
38542116
...
...
@@ -69,7 +69,7 @@ public:
*/
static
void
input_smbclient_init
(
gcc_unused
const
ConfigBlock
&
block
)
input_smbclient_init
(
EventLoop
&
,
const
ConfigBlock
&
)
{
try
{
SmbclientInit
();
...
...
test/dump_playlist.cxx
View file @
38542116
...
...
@@ -66,7 +66,7 @@ try {
const
ScopeIOThread
io_thread
;
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
playlist_list_global_init
();
decoder_plugin_init_all
();
...
...
test/dump_text_file.cxx
View file @
38542116
...
...
@@ -45,7 +45,7 @@ public:
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
}
~
GlobalInit
()
{
...
...
test/read_tags.cxx
View file @
38542116
...
...
@@ -88,7 +88,7 @@ try {
const
ScopeIOThread
io_thread
;
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
AtScopeExit
()
{
input_stream_global_finish
();
};
decoder_plugin_init_all
();
...
...
test/run_decoder.cxx
View file @
38542116
...
...
@@ -48,7 +48,7 @@ try {
const
ScopeIOThread
io_thread
;
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
decoder_plugin_init_all
();
...
...
test/run_input.cxx
View file @
38542116
...
...
@@ -47,7 +47,7 @@ public:
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
}
~
GlobalInit
()
{
...
...
test/visit_archive.cxx
View file @
38542116
...
...
@@ -44,7 +44,7 @@ public:
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
();
input_stream_global_init
(
io_thread_get
()
);
}
~
GlobalInit
()
{
...
...
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