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
bf6ed643
Commit
bf6ed643
authored
Aug 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InputPlugin: pass config_param reference
parent
a0beb5fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
InputInit.cxx
src/InputInit.cxx
+11
-8
InputPlugin.hxx
src/InputPlugin.hxx
+1
-1
CurlInputPlugin.cxx
src/input/CurlInputPlugin.cxx
+5
-6
FfmpegInputPlugin.cxx
src/input/FfmpegInputPlugin.cxx
+1
-1
No files found.
src/InputInit.cxx
View file @
bf6ed643
...
...
@@ -44,8 +44,7 @@ input_plugin_config(const char *plugin_name, GError **error_r)
const
struct
config_param
*
param
=
NULL
;
while
((
param
=
config_get_next_param
(
CONF_INPUT
,
param
))
!=
NULL
)
{
const
char
*
name
=
config_get_block_string
(
param
,
"plugin"
,
NULL
);
const
char
*
name
=
param
->
GetBlockValue
(
"plugin"
);
if
(
name
==
NULL
)
{
g_set_error
(
error_r
,
input_quark
(),
0
,
"input configuration without 'plugin' name in line %d"
,
...
...
@@ -63,6 +62,8 @@ input_plugin_config(const char *plugin_name, GError **error_r)
bool
input_stream_global_init
(
GError
**
error_r
)
{
const
config_param
empty
;
GError
*
error
=
NULL
;
for
(
unsigned
i
=
0
;
input_plugins
[
i
]
!=
NULL
;
++
i
)
{
...
...
@@ -74,16 +75,18 @@ input_stream_global_init(GError **error_r)
const
struct
config_param
*
param
=
input_plugin_config
(
plugin
->
name
,
&
error
);
if
(
param
==
NULL
&&
error
!=
NULL
)
{
g_propagate_error
(
error_r
,
error
);
return
false
;
}
if
(
param
==
nullptr
)
{
if
(
error
!=
nullptr
)
{
g_propagate_error
(
error_r
,
error
);
return
false
;
}
if
(
!
config_get_block_bool
(
param
,
"enabled"
,
true
))
param
=
&
empty
;
}
else
if
(
!
param
->
GetBlockValue
(
"enabled"
,
true
))
/* the plugin is disabled in mpd.conf */
continue
;
if
(
plugin
->
init
==
NULL
||
plugin
->
init
(
param
,
&
error
))
if
(
plugin
->
init
==
NULL
||
plugin
->
init
(
*
param
,
&
error
))
input_plugins_enabled
[
i
]
=
true
;
else
{
g_propagate_prefixed_error
(
error_r
,
error
,
...
...
src/InputPlugin.hxx
View file @
bf6ed643
...
...
@@ -39,7 +39,7 @@ struct input_plugin {
* @return true on success, false if the plugin should be
* disabled
*/
bool
(
*
init
)(
const
struct
config_param
*
param
,
GError
**
error_r
);
bool
(
*
init
)(
const
config_param
&
param
,
GError
**
error_r
);
/**
* Global deinitialization. Called once before MPD shuts
...
...
src/input/CurlInputPlugin.cxx
View file @
bf6ed643
...
...
@@ -614,7 +614,7 @@ CurlSockets::DispatchSockets()
*/
static
bool
input_curl_init
(
const
struct
config_param
*
param
,
input_curl_init
(
const
config_param
&
param
,
G_GNUC_UNUSED
GError
**
error_r
)
{
CURLcode
code
=
curl_global_init
(
CURL_GLOBAL_ALL
);
...
...
@@ -627,11 +627,10 @@ input_curl_init(const struct config_param *param,
http_200_aliases
=
curl_slist_append
(
http_200_aliases
,
"ICY 200 OK"
);
proxy
=
config_get_block_string
(
param
,
"proxy"
,
NULL
);
proxy_port
=
config_get_block_unsigned
(
param
,
"proxy_port"
,
0
);
proxy_user
=
config_get_block_string
(
param
,
"proxy_user"
,
NULL
);
proxy_password
=
config_get_block_string
(
param
,
"proxy_password"
,
NULL
);
proxy
=
param
.
GetBlockValue
(
"proxy"
);
proxy_port
=
param
.
GetBlockValue
(
"proxy_port"
,
0u
);
proxy_user
=
param
.
GetBlockValue
(
"proxy_user"
);
proxy_password
=
param
.
GetBlockValue
(
"proxy_password"
);
if
(
proxy
==
NULL
)
{
/* deprecated proxy configuration */
...
...
src/input/FfmpegInputPlugin.cxx
View file @
bf6ed643
...
...
@@ -76,7 +76,7 @@ input_ffmpeg_supported(void)
}
static
bool
input_ffmpeg_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
,
input_ffmpeg_init
(
gcc_unused
const
config_param
&
param
,
G_GNUC_UNUSED
GError
**
error_r
)
{
av_register_all
();
...
...
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