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