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
772d3da9
Commit
772d3da9
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no camel case in struct decoder_plugin
parent
f1a014d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
39 deletions
+41
-39
decode.c
src/decode.c
+22
-20
decoder_api.h
src/decoder_api.h
+8
-8
decoder_list.c
src/decoder_list.c
+4
-4
flac_plugin.c
src/inputPlugins/flac_plugin.c
+5
-5
song.c
src/song.c
+2
-2
No files found.
src/decode.c
View file @
772d3da9
...
...
@@ -244,14 +244,14 @@ static void decodeStart(void)
/* first we try mime types: */
while
(
ret
&&
(
plugin
=
getInputPluginFromMimeType
(
inStream
.
mime
,
next
++
)))
{
if
(
!
plugin
->
stream
DecodeF
unc
)
if
(
!
plugin
->
stream
_decode_f
unc
)
continue
;
if
(
!
(
plugin
->
stream
T
ypes
&
INPUT_PLUGIN_STREAM_URL
))
if
(
!
(
plugin
->
stream
_t
ypes
&
INPUT_PLUGIN_STREAM_URL
))
continue
;
if
(
plugin
->
try
DecodeF
unc
&&
!
plugin
->
try
DecodeF
unc
(
&
inStream
))
if
(
plugin
->
try
_decode_f
unc
&&
!
plugin
->
try
_decode_f
unc
(
&
inStream
))
continue
;
ret
=
plugin
->
stream
DecodeF
unc
(
&
decoder
,
&
inStream
);
ret
=
plugin
->
stream
_decode_f
unc
(
&
decoder
,
&
inStream
);
break
;
}
...
...
@@ -260,16 +260,17 @@ static void decodeStart(void)
const
char
*
s
=
getSuffix
(
path_max_utf8
);
next
=
0
;
while
(
ret
&&
(
plugin
=
getInputPluginFromSuffix
(
s
,
next
++
)))
{
if
(
!
plugin
->
stream
DecodeF
unc
)
if
(
!
plugin
->
stream
_decode_f
unc
)
continue
;
if
(
!
(
plugin
->
stream
T
ypes
&
if
(
!
(
plugin
->
stream
_t
ypes
&
INPUT_PLUGIN_STREAM_URL
))
continue
;
if
(
plugin
->
try
DecodeF
unc
&&
!
plugin
->
try
DecodeF
unc
(
&
inStream
))
if
(
plugin
->
try
_decode_f
unc
&&
!
plugin
->
try
_decode_f
unc
(
&
inStream
))
continue
;
decoder
.
plugin
=
plugin
;
ret
=
plugin
->
streamDecodeFunc
(
&
decoder
,
&
inStream
);
ret
=
plugin
->
stream_decode_func
(
&
decoder
,
&
inStream
);
break
;
}
}
...
...
@@ -281,31 +282,32 @@ static void decodeStart(void)
* need to check for stream{Types,DecodeFunc} */
if
((
plugin
=
getInputPluginFromName
(
"mp3"
)))
{
decoder
.
plugin
=
plugin
;
ret
=
plugin
->
stream
DecodeF
unc
(
&
decoder
,
&
inStream
);
ret
=
plugin
->
stream
_decode_f
unc
(
&
decoder
,
&
inStream
);
}
}
}
else
{
unsigned
int
next
=
0
;
const
char
*
s
=
getSuffix
(
path_max_utf8
);
while
(
ret
&&
(
plugin
=
getInputPluginFromSuffix
(
s
,
next
++
)))
{
if
(
!
plugin
->
stream
T
ypes
&
INPUT_PLUGIN_STREAM_FILE
)
if
(
!
plugin
->
stream
_t
ypes
&
INPUT_PLUGIN_STREAM_FILE
)
continue
;
if
(
plugin
->
try
DecodeF
unc
&&
!
plugin
->
try
DecodeF
unc
(
&
inStream
))
if
(
plugin
->
try
_decode_f
unc
&&
!
plugin
->
try
_decode_f
unc
(
&
inStream
))
continue
;
if
(
plugin
->
file
DecodeF
unc
)
{
if
(
plugin
->
file
_decode_f
unc
)
{
closeInputStream
(
&
inStream
);
close_instream
=
0
;
decoder
.
plugin
=
plugin
;
ret
=
plugin
->
file
DecodeF
unc
(
&
decoder
,
path_max_fs
);
ret
=
plugin
->
file
_decode_f
unc
(
&
decoder
,
path_max_fs
);
break
;
}
else
if
(
plugin
->
stream
DecodeF
unc
)
{
}
else
if
(
plugin
->
stream
_decode_f
unc
)
{
decoder
.
plugin
=
plugin
;
ret
=
plugin
->
streamDecodeFunc
(
&
decoder
,
&
inStream
);
ret
=
plugin
->
stream_decode_func
(
&
decoder
,
&
inStream
);
break
;
}
}
...
...
src/decoder_api.h
View file @
772d3da9
...
...
@@ -71,19 +71,19 @@ typedef MpdTag *(*decoder_tag_dup_func) (char *file);
struct
decoder_plugin
{
const
char
*
name
;
decoder_init_func
init
F
unc
;
decoder_finish_func
finish
F
unc
;
decoder_try_decode_func
try
DecodeF
unc
;
decoder_stream_decode_func
stream
DecodeF
unc
;
decoder_file_decode_func
file
DecodeF
unc
;
decoder_tag_dup_func
tag
DupF
unc
;
decoder_init_func
init
_f
unc
;
decoder_finish_func
finish
_f
unc
;
decoder_try_decode_func
try
_decode_f
unc
;
decoder_stream_decode_func
stream
_decode_f
unc
;
decoder_file_decode_func
file
_decode_f
unc
;
decoder_tag_dup_func
tag
_dup_f
unc
;
/* one or more of the INPUT_PLUGIN_STREAM_* values OR'd together */
unsigned
char
stream
T
ypes
;
unsigned
char
stream
_t
ypes
;
/* last element in these arrays must always be a NULL: */
const
char
*
const
*
suffixes
;
const
char
*
const
*
mime
T
ypes
;
const
char
*
const
*
mime
_t
ypes
;
};
...
...
src/decoder_list.c
View file @
772d3da9
...
...
@@ -39,7 +39,7 @@ void loadInputPlugin(struct decoder_plugin * inputPlugin)
if
(
!
inputPlugin
->
name
)
return
;
if
(
inputPlugin
->
init
Func
&&
inputPlugin
->
initF
unc
()
<
0
)
if
(
inputPlugin
->
init
_func
&&
inputPlugin
->
init_f
unc
()
<
0
)
return
;
insertInList
(
inputPlugin_list
,
inputPlugin
->
name
,
(
void
*
)
inputPlugin
);
...
...
@@ -47,8 +47,8 @@ void loadInputPlugin(struct decoder_plugin * inputPlugin)
void
unloadInputPlugin
(
struct
decoder_plugin
*
inputPlugin
)
{
if
(
inputPlugin
->
finish
F
unc
)
inputPlugin
->
finish
F
unc
();
if
(
inputPlugin
->
finish
_f
unc
)
inputPlugin
->
finish
_f
unc
();
deleteFromList
(
inputPlugin_list
,
inputPlugin
->
name
);
}
...
...
@@ -105,7 +105,7 @@ struct decoder_plugin *getInputPluginFromMimeType(const char *mimeType, unsigned
while
(
node
!=
NULL
)
{
plugin
=
node
->
data
;
if
(
stringFoundInStringArray
(
plugin
->
mime
T
ypes
,
mimeType
))
{
if
(
stringFoundInStringArray
(
plugin
->
mime
_t
ypes
,
mimeType
))
{
pos
=
node
->
nextNode
;
return
plugin
;
}
...
...
src/inputPlugins/flac_plugin.c
View file @
772d3da9
...
...
@@ -526,13 +526,13 @@ static int flac_plugin_init(void)
DEBUG
(
"libFLAC supports OggFLAC, initializing OggFLAC support
\n
"
);
assert
(
oggflacPlugin
.
name
==
NULL
);
oggflacPlugin
.
name
=
"oggflac"
;
oggflacPlugin
.
try
DecodeF
unc
=
oggflac_try_decode
;
oggflacPlugin
.
stream
DecodeF
unc
=
oggflac_decode
;
oggflacPlugin
.
tag
DupF
unc
=
oggflac_tag_dup
;
oggflacPlugin
.
stream
T
ypes
=
INPUT_PLUGIN_STREAM_URL
|
oggflacPlugin
.
try
_decode_f
unc
=
oggflac_try_decode
;
oggflacPlugin
.
stream
_decode_f
unc
=
oggflac_decode
;
oggflacPlugin
.
tag
_dup_f
unc
=
oggflac_tag_dup
;
oggflacPlugin
.
stream
_t
ypes
=
INPUT_PLUGIN_STREAM_URL
|
INPUT_PLUGIN_STREAM_FILE
;
oggflacPlugin
.
suffixes
=
oggflac_suffixes
;
oggflacPlugin
.
mime
T
ypes
=
oggflac_mime_types
;
oggflacPlugin
.
mime
_t
ypes
=
oggflac_mime_types
;
loadInputPlugin
(
&
oggflacPlugin
);
return
1
;
}
...
...
src/song.c
View file @
772d3da9
...
...
@@ -72,7 +72,7 @@ Song *newSong(const char *url, int type, Directory * parentDir)
while
(
!
song
->
tag
&&
(
plugin
=
isMusic
(
abs_path
,
&
(
song
->
mtime
),
next
++
)))
{
song
->
tag
=
plugin
->
tag
DupF
unc
(
abs_path
);
song
->
tag
=
plugin
->
tag
_dup_f
unc
(
abs_path
);
}
if
(
!
song
->
tag
||
song
->
tag
->
time
<
0
)
{
freeSong
(
song
);
...
...
@@ -303,7 +303,7 @@ int updateSongInfo(Song * song)
while
(
!
song
->
tag
&&
(
plugin
=
isMusic
(
abs_path
,
&
(
song
->
mtime
),
next
++
)))
{
song
->
tag
=
plugin
->
tag
DupF
unc
(
abs_path
);
song
->
tag
=
plugin
->
tag
_dup_f
unc
(
abs_path
);
}
if
(
!
song
->
tag
||
song
->
tag
->
time
<
0
)
return
-
1
;
...
...
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