Commit 0b614fba authored by Max Kellermann's avatar Max Kellermann

decoder: make all decoder_plugin structs const

All decoder_plugin structs are initialized at compile time, and must never change.
parent 1a4a3e1f
...@@ -589,7 +589,7 @@ static struct tag *aacTagDup(const char *file) ...@@ -589,7 +589,7 @@ static struct tag *aacTagDup(const char *file)
static const char *aac_suffixes[] = { "aac", NULL }; static const char *aac_suffixes[] = { "aac", NULL };
static const char *aac_mimeTypes[] = { "audio/aac", "audio/aacp", NULL }; static const char *aac_mimeTypes[] = { "audio/aac", "audio/aacp", NULL };
struct decoder_plugin aacPlugin = { const struct decoder_plugin aacPlugin = {
.name = "aac", .name = "aac",
.stream_decode = aac_stream_decode, .stream_decode = aac_stream_decode,
.file_decode = aac_decode, .file_decode = aac_decode,
......
...@@ -135,7 +135,7 @@ static struct tag *audiofileTagDup(const char *file) ...@@ -135,7 +135,7 @@ static struct tag *audiofileTagDup(const char *file)
static const char *audiofileSuffixes[] = { "wav", "au", "aiff", "aif", NULL }; static const char *audiofileSuffixes[] = { "wav", "au", "aiff", "aif", NULL };
struct decoder_plugin audiofilePlugin = { const struct decoder_plugin audiofilePlugin = {
.name = "audiofile", .name = "audiofile",
.file_decode = audiofile_decode, .file_decode = audiofile_decode,
.tag_dup = audiofileTagDup, .tag_dup = audiofileTagDup,
......
...@@ -380,7 +380,7 @@ static const char *ffmpeg_Mimetypes[] = { ...@@ -380,7 +380,7 @@ static const char *ffmpeg_Mimetypes[] = {
NULL NULL
}; };
struct decoder_plugin ffmpegPlugin = { const struct decoder_plugin ffmpegPlugin = {
.name = "ffmpeg", .name = "ffmpeg",
.init = ffmpeg_init, .init = ffmpeg_init,
.try_decode = ffmpeg_try_decode, .try_decode = ffmpeg_try_decode,
......
...@@ -435,7 +435,7 @@ static const char *oggflac_mime_types[] = { "audio/x-flac+ogg", ...@@ -435,7 +435,7 @@ static const char *oggflac_mime_types[] = { "audio/x-flac+ogg",
"application/x-ogg", "application/x-ogg",
NULL }; NULL };
struct decoder_plugin oggflacPlugin = { const struct decoder_plugin oggflacPlugin = {
.name = "oggflac", .name = "oggflac",
.try_decode = oggflac_try_decode, .try_decode = oggflac_try_decode,
.stream_decode = oggflac_decode, .stream_decode = oggflac_decode,
...@@ -452,7 +452,7 @@ static const char *flac_mime_types[] = { "audio/x-flac", ...@@ -452,7 +452,7 @@ static const char *flac_mime_types[] = { "audio/x-flac",
"application/x-flac", "application/x-flac",
NULL }; NULL };
struct decoder_plugin flacPlugin = { const struct decoder_plugin flacPlugin = {
.name = "flac", .name = "flac",
.stream_decode = flac_decode, .stream_decode = flac_decode,
.tag_dup = flacTagDup, .tag_dup = flacTagDup,
......
...@@ -281,7 +281,7 @@ static const char *modSuffixes[] = { "amf", ...@@ -281,7 +281,7 @@ static const char *modSuffixes[] = { "amf",
NULL NULL
}; };
struct decoder_plugin modPlugin = { const struct decoder_plugin modPlugin = {
.name = "mod", .name = "mod",
.finish = mod_finishMikMod, .finish = mod_finishMikMod,
.file_decode = mod_decode, .file_decode = mod_decode,
......
...@@ -1146,7 +1146,7 @@ static struct tag *mp3_tag_dup(const char *file) ...@@ -1146,7 +1146,7 @@ static struct tag *mp3_tag_dup(const char *file)
static const char *mp3_suffixes[] = { "mp3", "mp2", NULL }; static const char *mp3_suffixes[] = { "mp3", "mp2", NULL };
static const char *mp3_mime_types[] = { "audio/mpeg", NULL }; static const char *mp3_mime_types[] = { "audio/mpeg", NULL };
struct decoder_plugin mp3Plugin = { const struct decoder_plugin mp3Plugin = {
.name = "mp3", .name = "mp3",
.init = mp3_plugin_init, .init = mp3_plugin_init,
.stream_decode = mp3_decode, .stream_decode = mp3_decode,
......
...@@ -413,7 +413,7 @@ static struct tag *mp4TagDup(const char *file) ...@@ -413,7 +413,7 @@ static struct tag *mp4TagDup(const char *file)
static const char *mp4_suffixes[] = { "m4a", "mp4", NULL }; static const char *mp4_suffixes[] = { "m4a", "mp4", NULL };
static const char *mp4_mimeTypes[] = { "audio/mp4", "audio/m4a", NULL }; static const char *mp4_mimeTypes[] = { "audio/mp4", "audio/m4a", NULL };
struct decoder_plugin mp4Plugin = { const struct decoder_plugin mp4Plugin = {
.name = "mp4", .name = "mp4",
.stream_decode = mp4_decode, .stream_decode = mp4_decode,
.tag_dup = mp4TagDup, .tag_dup = mp4TagDup,
......
...@@ -297,7 +297,7 @@ static struct tag *mpcTagDup(const char *file) ...@@ -297,7 +297,7 @@ static struct tag *mpcTagDup(const char *file)
static const char *mpcSuffixes[] = { "mpc", NULL }; static const char *mpcSuffixes[] = { "mpc", NULL };
struct decoder_plugin mpcPlugin = { const struct decoder_plugin mpcPlugin = {
.name = "mpc", .name = "mpc",
.stream_decode = mpc_decode, .stream_decode = mpc_decode,
.tag_dup = mpcTagDup, .tag_dup = mpcTagDup,
......
...@@ -343,7 +343,7 @@ static const char *oggflac_mime_types[] = { "audio/x-flac+ogg", ...@@ -343,7 +343,7 @@ static const char *oggflac_mime_types[] = { "audio/x-flac+ogg",
"application/x-ogg", "application/x-ogg",
NULL }; NULL };
struct decoder_plugin oggflacPlugin = { const struct decoder_plugin oggflacPlugin = {
.name = "oggflac", .name = "oggflac",
.try_decode = oggflac_try_decode, .try_decode = oggflac_try_decode,
.stream_decode = oggflac_decode, .stream_decode = oggflac_decode,
......
...@@ -374,7 +374,7 @@ static const char *oggvorbis_MimeTypes[] = { "application/ogg", ...@@ -374,7 +374,7 @@ static const char *oggvorbis_MimeTypes[] = { "application/ogg",
"application/x-ogg", "application/x-ogg",
NULL }; NULL };
struct decoder_plugin oggvorbisPlugin = { const struct decoder_plugin oggvorbisPlugin = {
.name = "oggvorbis", .name = "oggvorbis",
.try_decode = oggvorbis_try_decode, .try_decode = oggvorbis_try_decode,
.stream_decode = oggvorbis_decode, .stream_decode = oggvorbis_decode,
......
...@@ -562,7 +562,7 @@ wavpack_filedecode(struct decoder *decoder, const char *fname) ...@@ -562,7 +562,7 @@ wavpack_filedecode(struct decoder *decoder, const char *fname)
static char const *wavpackSuffixes[] = { "wv", NULL }; static char const *wavpackSuffixes[] = { "wv", NULL };
static char const *wavpackMimeTypes[] = { "audio/x-wavpack", NULL }; static char const *wavpackMimeTypes[] = { "audio/x-wavpack", NULL };
struct decoder_plugin wavpackPlugin = { const struct decoder_plugin wavpackPlugin = {
.name = "wavpack", .name = "wavpack",
.try_decode = wavpack_trydecode, .try_decode = wavpack_trydecode,
.stream_decode = wavpack_streamdecode, .stream_decode = wavpack_streamdecode,
......
...@@ -21,17 +21,17 @@ ...@@ -21,17 +21,17 @@
#include <glib.h> #include <glib.h>
extern struct decoder_plugin mp3Plugin; extern const struct decoder_plugin mp3Plugin;
extern struct decoder_plugin oggvorbisPlugin; extern const struct decoder_plugin oggvorbisPlugin;
extern struct decoder_plugin flacPlugin; extern const struct decoder_plugin flacPlugin;
extern struct decoder_plugin oggflacPlugin; extern const struct decoder_plugin oggflacPlugin;
extern struct decoder_plugin audiofilePlugin; extern const struct decoder_plugin audiofilePlugin;
extern struct decoder_plugin mp4Plugin; extern const struct decoder_plugin mp4Plugin;
extern struct decoder_plugin aacPlugin; extern const struct decoder_plugin aacPlugin;
extern struct decoder_plugin mpcPlugin; extern const struct decoder_plugin mpcPlugin;
extern struct decoder_plugin wavpackPlugin; extern const struct decoder_plugin wavpackPlugin;
extern struct decoder_plugin modPlugin; extern const struct decoder_plugin modPlugin;
extern struct decoder_plugin ffmpegPlugin; extern const struct decoder_plugin ffmpegPlugin;
static const struct decoder_plugin *const decoder_plugins[] = { static const struct decoder_plugin *const decoder_plugins[] = {
#ifdef HAVE_MAD #ifdef HAVE_MAD
......
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