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: */
while (ret && (plugin = getInputPluginFromMimeType(inStream.mime, next++))) {
if (!plugin->streamDecodeFunc)
if (!plugin->stream_decode_func)
continue;
if (!(plugin->streamTypes & INPUT_PLUGIN_STREAM_URL))
if (!(plugin->stream_types & INPUT_PLUGIN_STREAM_URL))
continue;
if (plugin->tryDecodeFunc
&& !plugin->tryDecodeFunc(&inStream))
if (plugin->try_decode_func
&& !plugin->try_decode_func(&inStream))
continue;
ret = plugin->streamDecodeFunc(&decoder, &inStream);
ret = plugin->stream_decode_func(&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->streamDecodeFunc)
if (!plugin->stream_decode_func)
continue;
if (!(plugin->streamTypes &
if (!(plugin->stream_types &
INPUT_PLUGIN_STREAM_URL))
continue;
if (plugin->tryDecodeFunc &&
!plugin->tryDecodeFunc(&inStream))
if (plugin->try_decode_func &&
!plugin->try_decode_func(&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->streamDecodeFunc(&decoder,
&inStream);
ret = plugin->stream_decode_func(&decoder,
&inStream);
}
}
} else {
unsigned int next = 0;
const char *s = getSuffix(path_max_utf8);
while (ret && (plugin = getInputPluginFromSuffix(s, next++))) {
if (!plugin->streamTypes & INPUT_PLUGIN_STREAM_FILE)
if (!plugin->stream_types & INPUT_PLUGIN_STREAM_FILE)
continue;
if (plugin->tryDecodeFunc &&
!plugin->tryDecodeFunc(&inStream))
if (plugin->try_decode_func &&
!plugin->try_decode_func(&inStream))
continue;
if (plugin->fileDecodeFunc) {
if (plugin->file_decode_func) {
closeInputStream(&inStream);
close_instream = 0;
decoder.plugin = plugin;
ret = plugin->fileDecodeFunc(&decoder,
path_max_fs);
ret = plugin->file_decode_func(&decoder,
path_max_fs);
break;
} else if (plugin->streamDecodeFunc) {
} else if (plugin->stream_decode_func) {
decoder.plugin = plugin;
ret = plugin->streamDecodeFunc(&decoder, &inStream);
ret = plugin->stream_decode_func(&decoder,
&inStream);
break;
}
}

View File

@ -71,19 +71,19 @@ typedef MpdTag *(*decoder_tag_dup_func) (char *file);
struct decoder_plugin {
const char *name;
decoder_init_func initFunc;
decoder_finish_func finishFunc;
decoder_try_decode_func tryDecodeFunc;
decoder_stream_decode_func streamDecodeFunc;
decoder_file_decode_func fileDecodeFunc;
decoder_tag_dup_func tagDupFunc;
decoder_init_func init_func;
decoder_finish_func finish_func;
decoder_try_decode_func try_decode_func;
decoder_stream_decode_func stream_decode_func;
decoder_file_decode_func file_decode_func;
decoder_tag_dup_func tag_dup_func;
/* 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: */
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)
return;
if (inputPlugin->initFunc && inputPlugin->initFunc() < 0)
if (inputPlugin->init_func && inputPlugin->init_func() < 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->finishFunc)
inputPlugin->finishFunc();
if (inputPlugin->finish_func)
inputPlugin->finish_func();
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->mimeTypes, mimeType)) {
if (stringFoundInStringArray(plugin->mime_types, mimeType)) {
pos = node->nextNode;
return plugin;
}

View File

@ -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.tryDecodeFunc = oggflac_try_decode;
oggflacPlugin.streamDecodeFunc = oggflac_decode;
oggflacPlugin.tagDupFunc = oggflac_tag_dup;
oggflacPlugin.streamTypes = INPUT_PLUGIN_STREAM_URL |
oggflacPlugin.try_decode_func = oggflac_try_decode;
oggflacPlugin.stream_decode_func = oggflac_decode;
oggflacPlugin.tag_dup_func = oggflac_tag_dup;
oggflacPlugin.stream_types = INPUT_PLUGIN_STREAM_URL |
INPUT_PLUGIN_STREAM_FILE;
oggflacPlugin.suffixes = oggflac_suffixes;
oggflacPlugin.mimeTypes = oggflac_mime_types;
oggflacPlugin.mime_types = oggflac_mime_types;
loadInputPlugin(&oggflacPlugin);
return 1;
}

View File

@ -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->tagDupFunc(abs_path);
song->tag = plugin->tag_dup_func(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->tagDupFunc(abs_path);
song->tag = plugin->tag_dup_func(abs_path);
}
if (!song->tag || song->tag->time < 0)
return -1;