Commit 4c1b96c3 authored by Max Kellermann's avatar Max Kellermann

decoder: make the suffixes and mime_types arrays really const

The strings were constant, but the pointers weren't. C syntax is somewhat tricky..
parent 0b614fba
......@@ -586,8 +586,8 @@ static struct tag *aacTagDup(const char *file)
return ret;
}
static const char *aac_suffixes[] = { "aac", NULL };
static const char *aac_mimeTypes[] = { "audio/aac", "audio/aacp", NULL };
static const char *const aac_suffixes[] = { "aac", NULL };
static const char *const aac_mimeTypes[] = { "audio/aac", "audio/aacp", NULL };
const struct decoder_plugin aacPlugin = {
.name = "aac",
......
......@@ -133,7 +133,9 @@ static struct tag *audiofileTagDup(const char *file)
return ret;
}
static const char *audiofileSuffixes[] = { "wav", "au", "aiff", "aif", NULL };
static const char *const audiofileSuffixes[] = {
"wav", "au", "aiff", "aif", NULL
};
const struct decoder_plugin audiofilePlugin = {
.name = "audiofile",
......
......@@ -359,14 +359,14 @@ static struct tag *ffmpeg_tag(const char *file)
* only that files
*/
static const char *ffmpeg_Suffixes[] = {
static const char *const ffmpeg_Suffixes[] = {
"wma", "asf", "wmv", "mpeg", "mpg", "avi", "vob", "mov", "qt", "swf", "rm", "swf",
"mp1", "mp2", "mp3", "mp4", "m4a", "flac", "ogg", "wav", "au", "aiff", "aif", "ac3", "aac", "mpc",
NULL
};
//not sure if this is correct...
static const char *ffmpeg_Mimetypes[] = {
static const char *const ffmpeg_Mimetypes[] = {
"video/x-ms-asf",
"audio/x-ms-wma",
"audio/x-ms-wax",
......
......@@ -429,11 +429,13 @@ oggflac_try_decode(struct input_stream *inStream)
ogg_stream_type_detect(inStream) == FLAC;
}
static const char *oggflac_suffixes[] = { "ogg", "oga", NULL };
static const char *oggflac_mime_types[] = { "audio/x-flac+ogg",
"application/ogg",
"application/x-ogg",
NULL };
static const char *const oggflac_suffixes[] = { "ogg", "oga", NULL };
static const char *const oggflac_mime_types[] = {
"audio/x-flac+ogg",
"application/ogg",
"application/x-ogg",
NULL
};
const struct decoder_plugin oggflacPlugin = {
.name = "oggflac",
......@@ -447,10 +449,10 @@ const struct decoder_plugin oggflacPlugin = {
#endif /* FLAC_API_VERSION_CURRENT >= 7 */
static const char *flacSuffixes[] = { "flac", NULL };
static const char *flac_mime_types[] = { "audio/x-flac",
"application/x-flac",
NULL };
static const char *const flacSuffixes[] = { "flac", NULL };
static const char *const flac_mime_types[] = {
"audio/x-flac", "application/x-flac", NULL
};
const struct decoder_plugin flacPlugin = {
.name = "flac",
......
......@@ -263,7 +263,8 @@ static struct tag *modTagDup(const char *file)
return ret;
}
static const char *modSuffixes[] = { "amf",
static const char *const modSuffixes[] = {
"amf",
"dsm",
"far",
"gdm",
......
......@@ -1143,8 +1143,8 @@ static struct tag *mp3_tag_dup(const char *file)
return ret;
}
static const char *mp3_suffixes[] = { "mp3", "mp2", NULL };
static const char *mp3_mime_types[] = { "audio/mpeg", NULL };
static const char *const mp3_suffixes[] = { "mp3", "mp2", NULL };
static const char *const mp3_mime_types[] = { "audio/mpeg", NULL };
const struct decoder_plugin mp3Plugin = {
.name = "mp3",
......
......@@ -410,8 +410,8 @@ static struct tag *mp4TagDup(const char *file)
return ret;
}
static const char *mp4_suffixes[] = { "m4a", "mp4", NULL };
static const char *mp4_mimeTypes[] = { "audio/mp4", "audio/m4a", NULL };
static const char *const mp4_suffixes[] = { "m4a", "mp4", NULL };
static const char *const mp4_mimeTypes[] = { "audio/mp4", "audio/m4a", NULL };
const struct decoder_plugin mp4Plugin = {
.name = "mp4",
......
......@@ -295,7 +295,7 @@ static struct tag *mpcTagDup(const char *file)
return ret;
}
static const char *mpcSuffixes[] = { "mpc", NULL };
static const char *const mpcSuffixes[] = { "mpc", NULL };
const struct decoder_plugin mpcPlugin = {
.name = "mpc",
......
......@@ -337,11 +337,13 @@ fail:
return ret;
}
static const char *oggflac_Suffixes[] = { "ogg", "oga",NULL };
static const char *oggflac_mime_types[] = { "audio/x-flac+ogg",
"application/ogg",
"application/x-ogg",
NULL };
static const char *const oggflac_Suffixes[] = { "ogg", "oga", NULL };
static const char *const oggflac_mime_types[] = {
"audio/x-flac+ogg",
"application/ogg",
"application/x-ogg",
NULL
};
const struct decoder_plugin oggflacPlugin = {
.name = "oggflac",
......
......@@ -368,11 +368,13 @@ oggvorbis_try_decode(struct input_stream *inStream)
return ogg_stream_type_detect(inStream) == VORBIS;
}
static const char *oggvorbis_Suffixes[] = { "ogg","oga", NULL };
static const char *oggvorbis_MimeTypes[] = { "application/ogg",
"audio/x-vorbis+ogg",
"application/x-ogg",
NULL };
static const char *const oggvorbis_Suffixes[] = { "ogg","oga", NULL };
static const char *const oggvorbis_MimeTypes[] = {
"application/ogg",
"audio/x-vorbis+ogg",
"application/x-ogg",
NULL
};
const struct decoder_plugin oggvorbisPlugin = {
.name = "oggvorbis",
......
......@@ -559,8 +559,8 @@ wavpack_filedecode(struct decoder *decoder, const char *fname)
return true;
}
static char const *wavpackSuffixes[] = { "wv", NULL };
static char const *wavpackMimeTypes[] = { "audio/x-wavpack", NULL };
static char const *const wavpackSuffixes[] = { "wv", NULL };
static char const *const wavpackMimeTypes[] = { "audio/x-wavpack", NULL };
const struct decoder_plugin wavpackPlugin = {
.name = "wavpack",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment