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
6cfacc77
Commit
6cfacc77
authored
Feb 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_list: added configuration block "decoder"
The "decoder" configuration block may contain the configuration of one decoder plugin.
parent
dec5d48f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
conf.c
src/conf.c
+1
-0
conf.h
src/conf.h
+1
-0
decoder_list.c
src/decoder_list.c
+29
-1
No files found.
src/conf.c
View file @
6cfacc77
...
...
@@ -210,6 +210,7 @@ void config_global_init(void)
registerConfigParam
(
CONF_ID3V1_ENCODING
,
0
,
0
);
registerConfigParam
(
CONF_METADATA_TO_USE
,
0
,
0
);
registerConfigParam
(
CONF_SAVE_ABSOLUTE_PATHS
,
0
,
0
);
registerConfigParam
(
CONF_DECODER
,
true
,
true
);
registerConfigParam
(
CONF_GAPLESS_MP3_PLAYBACK
,
0
,
0
);
}
...
...
src/conf.h
View file @
6cfacc77
...
...
@@ -64,6 +64,7 @@
#define CONF_ID3V1_ENCODING "id3v1_encoding"
#define CONF_METADATA_TO_USE "metadata_to_use"
#define CONF_SAVE_ABSOLUTE_PATHS "save_absolute_paths_in_playlists"
#define CONF_DECODER "decoder"
#define CONF_GAPLESS_MP3_PLAYBACK "gapless_mp3_playback"
#define CONF_BOOL_UNSET -1
...
...
src/decoder_list.c
View file @
6cfacc77
...
...
@@ -20,6 +20,7 @@
#include "decoder_plugin.h"
#include "utils.h"
#include "config.h"
#include "conf.h"
#include <glib.h>
...
...
@@ -185,12 +186,39 @@ void decoder_plugin_print_all_decoders(FILE * fp)
fflush
(
fp
);
}
/**
* Find the "decoder" configuration block for the specified plugin.
*
* @param plugin_name the name of the decoder plugin
* @return the configuration block, or NULL if none was configured
*/
static
const
struct
config_param
*
decoder_plugin_config
(
const
char
*
plugin_name
)
{
const
struct
config_param
*
param
=
NULL
;
while
((
param
=
config_get_next_param
(
CONF_DECODER
,
param
))
!=
NULL
)
{
const
char
*
name
=
config_get_block_string
(
param
,
"plugin"
,
NULL
);
if
(
name
==
NULL
)
g_error
(
"decoder configuration without 'plugin' name in line %d"
,
param
->
line
);
if
(
strcmp
(
name
,
plugin_name
)
==
0
)
return
param
;
}
return
NULL
;
}
void
decoder_plugin_init_all
(
void
)
{
for
(
unsigned
i
=
0
;
i
<
num_decoder_plugins
;
++
i
)
{
const
struct
decoder_plugin
*
plugin
=
decoder_plugins
[
i
];
const
struct
config_param
*
param
=
decoder_plugin_config
(
plugin
->
name
);
if
(
decoder_plugin_init
(
plugin
,
NULL
))
if
(
decoder_plugin_init
(
plugin
,
param
))
decoder_plugins_enabled
[
i
]
=
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