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
e754ed01
Commit
e754ed01
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed functions in decoder_list.h
InputPlugin to decoder_plugin, and no camelCase.
parent
772d3da9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
36 deletions
+40
-36
decode.c
src/decode.c
+4
-4
decoder_list.c
src/decoder_list.c
+20
-18
decoder_list.h
src/decoder_list.h
+10
-8
flac_plugin.c
src/inputPlugins/flac_plugin.c
+1
-1
ls.c
src/ls.c
+1
-1
main.c
src/main.c
+4
-4
No files found.
src/decode.c
View file @
e754ed01
...
...
@@ -243,7 +243,7 @@ static void decodeStart(void)
unsigned
int
next
=
0
;
/* first we try mime types: */
while
(
ret
&&
(
plugin
=
getInputPluginFromMimeT
ype
(
inStream
.
mime
,
next
++
)))
{
while
(
ret
&&
(
plugin
=
decoder_plugin_from_mime_t
ype
(
inStream
.
mime
,
next
++
)))
{
if
(
!
plugin
->
stream_decode_func
)
continue
;
if
(
!
(
plugin
->
stream_types
&
INPUT_PLUGIN_STREAM_URL
))
...
...
@@ -259,7 +259,7 @@ static void decodeStart(void)
if
(
plugin
==
NULL
)
{
const
char
*
s
=
getSuffix
(
path_max_utf8
);
next
=
0
;
while
(
ret
&&
(
plugin
=
getInputPluginFromS
uffix
(
s
,
next
++
)))
{
while
(
ret
&&
(
plugin
=
decoder_plugin_from_s
uffix
(
s
,
next
++
)))
{
if
(
!
plugin
->
stream_decode_func
)
continue
;
if
(
!
(
plugin
->
stream_types
&
...
...
@@ -280,7 +280,7 @@ static void decodeStart(void)
if
(
plugin
==
NULL
)
{
/* we already know our mp3Plugin supports streams, no
* need to check for stream{Types,DecodeFunc} */
if
((
plugin
=
getInputPluginFromN
ame
(
"mp3"
)))
{
if
((
plugin
=
decoder_plugin_from_n
ame
(
"mp3"
)))
{
decoder
.
plugin
=
plugin
;
ret
=
plugin
->
stream_decode_func
(
&
decoder
,
&
inStream
);
...
...
@@ -289,7 +289,7 @@ static void decodeStart(void)
}
else
{
unsigned
int
next
=
0
;
const
char
*
s
=
getSuffix
(
path_max_utf8
);
while
(
ret
&&
(
plugin
=
getInputPluginFromS
uffix
(
s
,
next
++
)))
{
while
(
ret
&&
(
plugin
=
decoder_plugin_from_s
uffix
(
s
,
next
++
)))
{
if
(
!
plugin
->
stream_types
&
INPUT_PLUGIN_STREAM_FILE
)
continue
;
...
...
src/decoder_list.c
View file @
e754ed01
...
...
@@ -32,7 +32,7 @@ extern struct decoder_plugin modPlugin;
static
List
*
inputPlugin_list
;
void
loadInputPlugin
(
struct
decoder_plugin
*
inputPlugin
)
void
decoder_plugin_load
(
struct
decoder_plugin
*
inputPlugin
)
{
if
(
!
inputPlugin
)
return
;
...
...
@@ -45,7 +45,7 @@ void loadInputPlugin(struct decoder_plugin * inputPlugin)
insertInList
(
inputPlugin_list
,
inputPlugin
->
name
,
(
void
*
)
inputPlugin
);
}
void
unloadInputPlugin
(
struct
decoder_plugin
*
inputPlugin
)
void
decoder_plugin_unload
(
struct
decoder_plugin
*
inputPlugin
)
{
if
(
inputPlugin
->
finish_func
)
inputPlugin
->
finish_func
();
...
...
@@ -63,7 +63,8 @@ static int stringFoundInStringArray(const char *const*array, const char *suffix)
return
0
;
}
struct
decoder_plugin
*
getInputPluginFromSuffix
(
const
char
*
suffix
,
unsigned
int
next
)
struct
decoder_plugin
*
decoder_plugin_from_suffix
(
const
char
*
suffix
,
unsigned
int
next
)
{
static
ListNode
*
pos
;
ListNode
*
node
;
...
...
@@ -92,7 +93,8 @@ struct decoder_plugin *getInputPluginFromSuffix(const char *suffix, unsigned int
return
NULL
;
}
struct
decoder_plugin
*
getInputPluginFromMimeType
(
const
char
*
mimeType
,
unsigned
int
next
)
struct
decoder_plugin
*
decoder_plugin_from_mime_type
(
const
char
*
mimeType
,
unsigned
int
next
)
{
static
ListNode
*
pos
;
ListNode
*
node
;
...
...
@@ -115,7 +117,7 @@ struct decoder_plugin *getInputPluginFromMimeType(const char *mimeType, unsigned
return
NULL
;
}
struct
decoder_plugin
*
getInputPluginFromN
ame
(
const
char
*
name
)
struct
decoder_plugin
*
decoder_plugin_from_n
ame
(
const
char
*
name
)
{
void
*
plugin
=
NULL
;
...
...
@@ -124,7 +126,7 @@ struct decoder_plugin *getInputPluginFromName(const char *name)
return
(
struct
decoder_plugin
*
)
plugin
;
}
void
printAllInputPluginS
uffixes
(
FILE
*
fp
)
void
decoder_plugin_print_all_s
uffixes
(
FILE
*
fp
)
{
ListNode
*
node
=
inputPlugin_list
->
firstNode
;
struct
decoder_plugin
*
plugin
;
...
...
@@ -143,24 +145,24 @@ void printAllInputPluginSuffixes(FILE * fp)
fflush
(
fp
);
}
void
initInputPlugins
(
void
)
void
decoder_plugin_init_all
(
void
)
{
inputPlugin_list
=
makeList
(
NULL
,
1
);
/* load plugins here */
loadInputPlugin
(
&
mp3Plugin
);
loadInputPlugin
(
&
oggvorbisPlugin
);
loadInputPlugin
(
&
oggflacPlugin
);
loadInputPlugin
(
&
flacPlugin
);
loadInputPlugin
(
&
audiofilePlugin
);
loadInputPlugin
(
&
mp4Plugin
);
loadInputPlugin
(
&
aacPlugin
);
loadInputPlugin
(
&
mpcPlugin
);
loadInputPlugin
(
&
wavpackPlugin
);
loadInputPlugin
(
&
modPlugin
);
decoder_plugin_load
(
&
mp3Plugin
);
decoder_plugin_load
(
&
oggvorbisPlugin
);
decoder_plugin_load
(
&
oggflacPlugin
);
decoder_plugin_load
(
&
flacPlugin
);
decoder_plugin_load
(
&
audiofilePlugin
);
decoder_plugin_load
(
&
mp4Plugin
);
decoder_plugin_load
(
&
aacPlugin
);
decoder_plugin_load
(
&
mpcPlugin
);
decoder_plugin_load
(
&
wavpackPlugin
);
decoder_plugin_load
(
&
modPlugin
);
}
void
finishInputPlugins
(
void
)
void
decoder_plugin_deinit_all
(
void
)
{
freeList
(
inputPlugin_list
);
}
src/decoder_list.h
View file @
e754ed01
...
...
@@ -24,23 +24,25 @@
struct
decoder_plugin
;
/* individual functions to load/unload plugins */
void
loadInputPlugin
(
struct
decoder_plugin
*
inputPlugin
);
void
unloadInputPlugin
(
struct
decoder_plugin
*
inputPlugin
);
void
decoder_plugin_load
(
struct
decoder_plugin
*
inputPlugin
);
void
decoder_plugin_unload
(
struct
decoder_plugin
*
inputPlugin
);
/* interface for using plugins */
struct
decoder_plugin
*
getInputPluginFromSuffix
(
const
char
*
suffix
,
unsigned
int
next
);
struct
decoder_plugin
*
decoder_plugin_from_suffix
(
const
char
*
suffix
,
unsigned
int
next
);
struct
decoder_plugin
*
getInputPluginFromMimeType
(
const
char
*
mimeType
,
unsigned
int
next
);
struct
decoder_plugin
*
decoder_plugin_from_mime_type
(
const
char
*
mimeType
,
unsigned
int
next
);
struct
decoder_plugin
*
getInputPluginFromN
ame
(
const
char
*
name
);
struct
decoder_plugin
*
decoder_plugin_from_n
ame
(
const
char
*
name
);
void
printAllInputPluginS
uffixes
(
FILE
*
fp
);
void
decoder_plugin_print_all_s
uffixes
(
FILE
*
fp
);
/* this is where we "load" all the "plugins" ;-) */
void
initInputPlugins
(
void
);
void
decoder_plugin_init_all
(
void
);
/* this is where we "unload" all the "plugins" */
void
finishInputPlugins
(
void
);
void
decoder_plugin_deinit_all
(
void
);
#endif
src/inputPlugins/flac_plugin.c
View file @
e754ed01
...
...
@@ -533,7 +533,7 @@ static int flac_plugin_init(void)
INPUT_PLUGIN_STREAM_FILE
;
oggflacPlugin
.
suffixes
=
oggflac_suffixes
;
oggflacPlugin
.
mime_types
=
oggflac_mime_types
;
loadInputPlugin
(
&
oggflacPlugin
);
decoder_plugin_load
(
&
oggflacPlugin
);
return
1
;
}
...
...
src/ls.c
View file @
e754ed01
...
...
@@ -263,7 +263,7 @@ struct decoder_plugin *hasMusicSuffix(const char *utf8file, unsigned int next)
const
char
*
s
=
getSuffix
(
utf8file
);
if
(
s
)
{
ret
=
getInputPluginFromS
uffix
(
s
,
next
);
ret
=
decoder_plugin_from_s
uffix
(
s
,
next
);
}
else
{
DEBUG
(
"hasMusicSuffix: The file: %s has no valid suffix
\n
"
,
utf8file
);
...
...
src/main.c
View file @
e754ed01
...
...
@@ -128,8 +128,8 @@ static void version(void)
LOG
(
"
\n
"
);
LOG
(
"Supported formats:
\n
"
);
initInputPlugins
();
printAllInputPluginS
uffixes
(
stdout
);
decoder_plugin_init_all
();
decoder_plugin_print_all_s
uffixes
(
stdout
);
LOG
(
"
\n
"
);
LOG
(
"Supported outputs:
\n
"
);
...
...
@@ -407,7 +407,7 @@ int main(int argc, char *argv[])
initPaths
();
initPermissions
();
initPlaylist
();
initInputPlugins
();
decoder_plugin_init_all
();
openDB
(
&
options
,
argv
[
0
]);
...
...
@@ -461,7 +461,7 @@ int main(int argc, char *argv[])
finishPaths
();
finishPermissions
();
finishCommands
();
finishInputPlugins
();
decoder_plugin_deinit_all
();
cleanUpPidFile
();
finishConf
();
...
...
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