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
57d77cc8
Commit
57d77cc8
authored
Jul 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/List: use struct ConfigData
parent
9fe05850
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
9 deletions
+13
-9
Main.cxx
src/Main.cxx
+1
-1
DecoderList.cxx
src/decoder/DecoderList.cxx
+4
-3
DecoderList.hxx
src/decoder/DecoderList.hxx
+2
-1
ContainerScan.cxx
test/ContainerScan.cxx
+2
-1
dump_playlist.cxx
test/dump_playlist.cxx
+1
-1
read_tags.cxx
test/read_tags.cxx
+2
-1
run_decoder.cxx
test/run_decoder.cxx
+1
-1
No files found.
src/Main.cxx
View file @
57d77cc8
...
@@ -552,7 +552,7 @@ try {
...
@@ -552,7 +552,7 @@ try {
pcm_convert_global_init
();
pcm_convert_global_init
();
decoder_plugin_init_all
();
decoder_plugin_init_all
(
GetGlobalConfig
()
);
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
const
bool
create_db
=
InitDatabaseAndStorage
();
const
bool
create_db
=
InitDatabaseAndStorage
();
...
...
src/decoder/DecoderList.cxx
View file @
57d77cc8
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "config.h"
#include "DecoderList.hxx"
#include "DecoderList.hxx"
#include "DecoderPlugin.hxx"
#include "DecoderPlugin.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "config/Block.hxx"
#include "config/Block.hxx"
#include "plugins/AudiofileDecoderPlugin.hxx"
#include "plugins/AudiofileDecoderPlugin.hxx"
#include "plugins/PcmDecoderPlugin.hxx"
#include "plugins/PcmDecoderPlugin.hxx"
...
@@ -127,14 +127,15 @@ decoder_plugin_from_name(const char *name) noexcept
...
@@ -127,14 +127,15 @@ decoder_plugin_from_name(const char *name) noexcept
});
});
}
}
void
decoder_plugin_init_all
(
void
)
void
decoder_plugin_init_all
(
const
ConfigData
&
config
)
{
{
ConfigBlock
empty
;
ConfigBlock
empty
;
for
(
unsigned
i
=
0
;
decoder_plugins
[
i
]
!=
nullptr
;
++
i
)
{
for
(
unsigned
i
=
0
;
decoder_plugins
[
i
]
!=
nullptr
;
++
i
)
{
const
DecoderPlugin
&
plugin
=
*
decoder_plugins
[
i
];
const
DecoderPlugin
&
plugin
=
*
decoder_plugins
[
i
];
const
auto
*
param
=
const
auto
*
param
=
config
_find_b
lock
(
ConfigBlockOption
::
DECODER
,
"plugin"
,
config
.
FindB
lock
(
ConfigBlockOption
::
DECODER
,
"plugin"
,
plugin
.
name
);
plugin
.
name
);
if
(
param
==
nullptr
)
if
(
param
==
nullptr
)
...
...
src/decoder/DecoderList.hxx
View file @
57d77cc8
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "Compiler.h"
#include "Compiler.h"
struct
ConfigData
;
struct
DecoderPlugin
;
struct
DecoderPlugin
;
extern
const
struct
DecoderPlugin
*
const
decoder_plugins
[];
extern
const
struct
DecoderPlugin
*
const
decoder_plugins
[];
...
@@ -35,7 +36,7 @@ decoder_plugin_from_name(const char *name) noexcept;
...
@@ -35,7 +36,7 @@ decoder_plugin_from_name(const char *name) noexcept;
/* this is where we "load" all the "plugins" ;-) */
/* this is where we "load" all the "plugins" ;-) */
void
void
decoder_plugin_init_all
();
decoder_plugin_init_all
(
const
ConfigData
&
config
);
/* this is where we "unload" all the "plugins" */
/* this is where we "unload" all the "plugins" */
void
void
...
...
test/ContainerScan.cxx
View file @
57d77cc8
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "config.h"
#include "DetachedSong.hxx"
#include "DetachedSong.hxx"
#include "SongSave.hxx"
#include "SongSave.hxx"
#include "config/Data.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "fs/Path.hxx"
#include "fs/Path.hxx"
...
@@ -68,7 +69,7 @@ try {
...
@@ -68,7 +69,7 @@ try {
const
Path
path
=
Path
::
FromFS
(
argv
[
1
]);
const
Path
path
=
Path
::
FromFS
(
argv
[
1
]);
decoder_plugin_init_all
();
decoder_plugin_init_all
(
ConfigData
()
);
const
auto
*
plugin
=
FindContainerDecoderPlugin
(
path
);
const
auto
*
plugin
=
FindContainerDecoderPlugin
(
path
);
if
(
plugin
==
nullptr
)
{
if
(
plugin
==
nullptr
)
{
...
...
test/dump_playlist.cxx
View file @
57d77cc8
...
@@ -69,7 +69,7 @@ try {
...
@@ -69,7 +69,7 @@ try {
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
playlist_list_global_init
();
playlist_list_global_init
();
decoder_plugin_init_all
();
decoder_plugin_init_all
(
GetGlobalConfig
()
);
/* open the playlist */
/* open the playlist */
...
...
test/read_tags.cxx
View file @
57d77cc8
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
*/
*/
#include "config.h"
#include "config.h"
#include "config/Data.hxx"
#include "event/Thread.hxx"
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/DecoderPlugin.hxx"
...
@@ -95,7 +96,7 @@ try {
...
@@ -95,7 +96,7 @@ try {
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
AtScopeExit
()
{
input_stream_global_finish
();
};
AtScopeExit
()
{
input_stream_global_finish
();
};
decoder_plugin_init_all
();
decoder_plugin_init_all
(
ConfigData
()
);
AtScopeExit
()
{
decoder_plugin_deinit_all
();
};
AtScopeExit
()
{
decoder_plugin_deinit_all
();
};
plugin
=
decoder_plugin_from_name
(
decoder_name
);
plugin
=
decoder_plugin_from_name
(
decoder_name
);
...
...
test/run_decoder.cxx
View file @
57d77cc8
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
ReadConfigFile
(
config_path
);
ReadConfigFile
(
config_path
);
input_stream_global_init
(
io_thread
.
GetEventLoop
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
decoder_plugin_init_all
();
decoder_plugin_init_all
(
GetGlobalConfig
()
);
}
}
~
GlobalInit
()
{
~
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