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
dec5d48f
Commit
dec5d48f
authored
Feb 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_plugin: pass struct config_param to init() method
Preparing for per-plugin configuration sections in mpd.conf.
parent
900784bb
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
10 deletions
+18
-10
ffmpeg_plugin.c
src/decoder/ffmpeg_plugin.c
+2
-1
flac_plugin.c
src/decoder/flac_plugin.c
+1
-1
fluidsynth_plugin.c
src/decoder/fluidsynth_plugin.c
+1
-1
mikmod_plugin.c
src/decoder/mikmod_plugin.c
+2
-1
mp3_plugin.c
src/decoder/mp3_plugin.c
+2
-1
wildmidi_plugin.c
src/decoder/wildmidi_plugin.c
+1
-1
decoder_api.h
src/decoder_api.h
+1
-0
decoder_list.c
src/decoder_list.c
+1
-1
decoder_plugin.h
src/decoder_plugin.h
+7
-3
No files found.
src/decoder/ffmpeg_plugin.c
View file @
dec5d48f
...
...
@@ -120,7 +120,8 @@ static URLProtocol mpd_ffmpeg_fileops = {
.
url_close
=
mpd_ffmpeg_close
,
};
static
bool
ffmpeg_init
(
void
)
static
bool
ffmpeg_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
av_register_all
();
register_protocol
(
&
mpd_ffmpeg_fileops
);
...
...
src/decoder/flac_plugin.c
View file @
dec5d48f
...
...
@@ -383,7 +383,7 @@ flac_decode(struct decoder * decoder, struct input_stream *input_stream)
#ifndef HAVE_OGGFLAC
static
bool
oggflac_init
(
void
)
oggflac_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
return
!!
FLAC_API_SUPPORTS_OGG_FLAC
;
...
...
src/decoder/fluidsynth_plugin.c
View file @
dec5d48f
...
...
@@ -64,7 +64,7 @@ fluidsynth_mpd_log_function(int level, char *message, G_GNUC_UNUSED void *data)
}
static
bool
fluidsynth_init
(
void
)
fluidsynth_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
fluid_set_log_function
(
LAST_LOG_LEVEL
,
fluidsynth_mpd_log_function
,
NULL
);
...
...
src/decoder/mikmod_plugin.c
View file @
dec5d48f
...
...
@@ -90,7 +90,8 @@ static MDRIVER drv_mpd = {
VC_VoiceRealVolume
};
static
bool
mod_initMikMod
(
void
)
static
bool
mod_initMikMod
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
static
char
params
[]
=
""
;
...
...
src/decoder/mp3_plugin.c
View file @
dec5d48f
...
...
@@ -91,7 +91,8 @@ mad_fixed_to_24_buffer(int32_t *dest, const struct mad_synth *synth,
}
}
static
bool
mp3_plugin_init
(
void
)
static
bool
mp3_plugin_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
gapless_playback
=
config_get_bool
(
CONF_GAPLESS_MP3_PLAYBACK
,
DEFAULT_GAPLESS_MP3_PLAYBACK
);
...
...
src/decoder/wildmidi_plugin.c
View file @
dec5d48f
...
...
@@ -30,7 +30,7 @@ enum {
};
static
bool
wildmidi_init
(
void
)
wildmidi_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
int
ret
;
...
...
src/decoder_api.h
View file @
dec5d48f
...
...
@@ -32,6 +32,7 @@
#include "replay_gain.h"
#include "tag.h"
#include "audio_format.h"
#include "conf.h"
#include <stdbool.h>
...
...
src/decoder_list.c
View file @
dec5d48f
...
...
@@ -190,7 +190,7 @@ void decoder_plugin_init_all(void)
for
(
unsigned
i
=
0
;
i
<
num_decoder_plugins
;
++
i
)
{
const
struct
decoder_plugin
*
plugin
=
decoder_plugins
[
i
];
if
(
decoder_plugin_init
(
plugin
))
if
(
decoder_plugin_init
(
plugin
,
NULL
))
decoder_plugins_enabled
[
i
]
=
true
;
}
}
...
...
src/decoder_plugin.h
View file @
dec5d48f
...
...
@@ -22,6 +22,7 @@
#include <stdbool.h>
#include <stddef.h>
struct
config_param
;
struct
input_stream
;
struct
tag
;
...
...
@@ -39,7 +40,7 @@ struct decoder_plugin {
* have/need one this must return < 0 if there is an error and
* >= 0 otherwise
*/
bool
(
*
init
)(
void
);
bool
(
*
init
)(
const
struct
config_param
*
param
);
/**
* optional, set this to NULL if the InputPlugin doesn't have/need one
...
...
@@ -81,14 +82,17 @@ struct decoder_plugin {
/**
* Initialize a decoder plugin.
*
* @param param a configuration block for this plugin, or NULL if none
* is configured
* @return true if the plugin was initialized successfully, false if
* the plugin is not available
*/
static
inline
bool
decoder_plugin_init
(
const
struct
decoder_plugin
*
plugin
)
decoder_plugin_init
(
const
struct
decoder_plugin
*
plugin
,
const
struct
config_param
*
param
)
{
return
plugin
->
init
!=
NULL
?
plugin
->
init
()
?
plugin
->
init
(
param
)
:
true
;
}
...
...
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