no camel case in struct decoder_plugin

This commit is contained in:
Max Kellermann 2008-08-26 08:27:08 +02:00
parent f1a014d094
commit 772d3da98a
5 changed files with 41 additions and 39 deletions

View File

@ -244,14 +244,14 @@ static void decodeStart(void)
/* first we try mime types: */ /* first we try mime types: */
while (ret && (plugin = getInputPluginFromMimeType(inStream.mime, next++))) { while (ret && (plugin = getInputPluginFromMimeType(inStream.mime, next++))) {
if (!plugin->streamDecodeFunc) if (!plugin->stream_decode_func)
continue; continue;
if (!(plugin->streamTypes & INPUT_PLUGIN_STREAM_URL)) if (!(plugin->stream_types & INPUT_PLUGIN_STREAM_URL))
continue; continue;
if (plugin->tryDecodeFunc if (plugin->try_decode_func
&& !plugin->tryDecodeFunc(&inStream)) && !plugin->try_decode_func(&inStream))
continue; continue;
ret = plugin->streamDecodeFunc(&decoder, &inStream); ret = plugin->stream_decode_func(&decoder, &inStream);
break; break;
} }
@ -260,16 +260,17 @@ static void decodeStart(void)
const char *s = getSuffix(path_max_utf8); const char *s = getSuffix(path_max_utf8);
next = 0; next = 0;
while (ret && (plugin = getInputPluginFromSuffix(s, next++))) { while (ret && (plugin = getInputPluginFromSuffix(s, next++))) {
if (!plugin->streamDecodeFunc) if (!plugin->stream_decode_func)
continue; continue;
if (!(plugin->streamTypes & if (!(plugin->stream_types &
INPUT_PLUGIN_STREAM_URL)) INPUT_PLUGIN_STREAM_URL))
continue; continue;
if (plugin->tryDecodeFunc && if (plugin->try_decode_func &&
!plugin->tryDecodeFunc(&inStream)) !plugin->try_decode_func(&inStream))
continue; continue;
decoder.plugin = plugin; decoder.plugin = plugin;
ret = plugin->streamDecodeFunc(&decoder, &inStream); ret = plugin->stream_decode_func(&decoder,
&inStream);
break; break;
} }
} }
@ -281,31 +282,32 @@ static void decodeStart(void)
* need to check for stream{Types,DecodeFunc} */ * need to check for stream{Types,DecodeFunc} */
if ((plugin = getInputPluginFromName("mp3"))) { if ((plugin = getInputPluginFromName("mp3"))) {
decoder.plugin = plugin; decoder.plugin = plugin;
ret = plugin->streamDecodeFunc(&decoder, ret = plugin->stream_decode_func(&decoder,
&inStream); &inStream);
} }
} }
} else { } else {
unsigned int next = 0; unsigned int next = 0;
const char *s = getSuffix(path_max_utf8); const char *s = getSuffix(path_max_utf8);
while (ret && (plugin = getInputPluginFromSuffix(s, next++))) { while (ret && (plugin = getInputPluginFromSuffix(s, next++))) {
if (!plugin->streamTypes & INPUT_PLUGIN_STREAM_FILE) if (!plugin->stream_types & INPUT_PLUGIN_STREAM_FILE)
continue; continue;
if (plugin->tryDecodeFunc && if (plugin->try_decode_func &&
!plugin->tryDecodeFunc(&inStream)) !plugin->try_decode_func(&inStream))
continue; continue;
if (plugin->fileDecodeFunc) { if (plugin->file_decode_func) {
closeInputStream(&inStream); closeInputStream(&inStream);
close_instream = 0; close_instream = 0;
decoder.plugin = plugin; decoder.plugin = plugin;
ret = plugin->fileDecodeFunc(&decoder, ret = plugin->file_decode_func(&decoder,
path_max_fs); path_max_fs);
break; break;
} else if (plugin->streamDecodeFunc) { } else if (plugin->stream_decode_func) {
decoder.plugin = plugin; decoder.plugin = plugin;
ret = plugin->streamDecodeFunc(&decoder, &inStream); ret = plugin->stream_decode_func(&decoder,
&inStream);
break; break;
} }
} }

View File

@ -71,19 +71,19 @@ typedef MpdTag *(*decoder_tag_dup_func) (char *file);
struct decoder_plugin { struct decoder_plugin {
const char *name; const char *name;
decoder_init_func initFunc; decoder_init_func init_func;
decoder_finish_func finishFunc; decoder_finish_func finish_func;
decoder_try_decode_func tryDecodeFunc; decoder_try_decode_func try_decode_func;
decoder_stream_decode_func streamDecodeFunc; decoder_stream_decode_func stream_decode_func;
decoder_file_decode_func fileDecodeFunc; decoder_file_decode_func file_decode_func;
decoder_tag_dup_func tagDupFunc; decoder_tag_dup_func tag_dup_func;
/* one or more of the INPUT_PLUGIN_STREAM_* values OR'd together */ /* one or more of the INPUT_PLUGIN_STREAM_* values OR'd together */
unsigned char streamTypes; unsigned char stream_types;
/* last element in these arrays must always be a NULL: */ /* last element in these arrays must always be a NULL: */
const char *const*suffixes; const char *const*suffixes;
const char *const*mimeTypes; const char *const*mime_types;
}; };

View File

@ -39,7 +39,7 @@ void loadInputPlugin(struct decoder_plugin * inputPlugin)
if (!inputPlugin->name) if (!inputPlugin->name)
return; return;
if (inputPlugin->initFunc && inputPlugin->initFunc() < 0) if (inputPlugin->init_func && inputPlugin->init_func() < 0)
return; return;
insertInList(inputPlugin_list, inputPlugin->name, (void *)inputPlugin); insertInList(inputPlugin_list, inputPlugin->name, (void *)inputPlugin);
@ -47,8 +47,8 @@ void loadInputPlugin(struct decoder_plugin * inputPlugin)
void unloadInputPlugin(struct decoder_plugin * inputPlugin) void unloadInputPlugin(struct decoder_plugin * inputPlugin)
{ {
if (inputPlugin->finishFunc) if (inputPlugin->finish_func)
inputPlugin->finishFunc(); inputPlugin->finish_func();
deleteFromList(inputPlugin_list, inputPlugin->name); deleteFromList(inputPlugin_list, inputPlugin->name);
} }
@ -105,7 +105,7 @@ struct decoder_plugin *getInputPluginFromMimeType(const char *mimeType, unsigned
while (node != NULL) { while (node != NULL) {
plugin = node->data; plugin = node->data;
if (stringFoundInStringArray(plugin->mimeTypes, mimeType)) { if (stringFoundInStringArray(plugin->mime_types, mimeType)) {
pos = node->nextNode; pos = node->nextNode;
return plugin; return plugin;
} }

View File

@ -526,13 +526,13 @@ static int flac_plugin_init(void)
DEBUG("libFLAC supports OggFLAC, initializing OggFLAC support\n"); DEBUG("libFLAC supports OggFLAC, initializing OggFLAC support\n");
assert(oggflacPlugin.name == NULL); assert(oggflacPlugin.name == NULL);
oggflacPlugin.name = "oggflac"; oggflacPlugin.name = "oggflac";
oggflacPlugin.tryDecodeFunc = oggflac_try_decode; oggflacPlugin.try_decode_func = oggflac_try_decode;
oggflacPlugin.streamDecodeFunc = oggflac_decode; oggflacPlugin.stream_decode_func = oggflac_decode;
oggflacPlugin.tagDupFunc = oggflac_tag_dup; oggflacPlugin.tag_dup_func = oggflac_tag_dup;
oggflacPlugin.streamTypes = INPUT_PLUGIN_STREAM_URL | oggflacPlugin.stream_types = INPUT_PLUGIN_STREAM_URL |
INPUT_PLUGIN_STREAM_FILE; INPUT_PLUGIN_STREAM_FILE;
oggflacPlugin.suffixes = oggflac_suffixes; oggflacPlugin.suffixes = oggflac_suffixes;
oggflacPlugin.mimeTypes = oggflac_mime_types; oggflacPlugin.mime_types = oggflac_mime_types;
loadInputPlugin(&oggflacPlugin); loadInputPlugin(&oggflacPlugin);
return 1; return 1;
} }

View File

@ -72,7 +72,7 @@ Song *newSong(const char *url, int type, Directory * parentDir)
while (!song->tag && (plugin = isMusic(abs_path, while (!song->tag && (plugin = isMusic(abs_path,
&(song->mtime), &(song->mtime),
next++))) { next++))) {
song->tag = plugin->tagDupFunc(abs_path); song->tag = plugin->tag_dup_func(abs_path);
} }
if (!song->tag || song->tag->time < 0) { if (!song->tag || song->tag->time < 0) {
freeSong(song); freeSong(song);
@ -303,7 +303,7 @@ int updateSongInfo(Song * song)
while (!song->tag && (plugin = isMusic(abs_path, while (!song->tag && (plugin = isMusic(abs_path,
&(song->mtime), &(song->mtime),
next++))) { next++))) {
song->tag = plugin->tagDupFunc(abs_path); song->tag = plugin->tag_dup_func(abs_path);
} }
if (!song->tag || song->tag->time < 0) if (!song->tag || song->tag->time < 0)
return -1; return -1;