diff options
82 files changed, 204 insertions, 208 deletions
diff --git a/audio/chmap.c b/audio/chmap.c index 9a18512e21..316ca35c94 100644 --- a/audio/chmap.c +++ b/audio/chmap.c @@ -23,7 +23,7 @@ // Names taken from libavutil/channel_layout.c (Not accessible by API.) // Use of these names is hard-coded in some places (e.g. ao_alsa.c) -static const char *speaker_names[MP_SPEAKER_ID_COUNT][2] = { +static const char *const speaker_names[MP_SPEAKER_ID_COUNT][2] = { [MP_SPEAKER_ID_FL] = {"fl", "front left"}, [MP_SPEAKER_ID_FR] = {"fr", "front right"}, [MP_SPEAKER_ID_FC] = {"fc", "front center"}, @@ -53,7 +53,7 @@ static const char *speaker_names[MP_SPEAKER_ID_COUNT][2] = { // Names taken from libavutil/channel_layout.c (Not accessible by API.) // Channel order corresponds to lavc/waveex, except for the alsa entries. -static const char *std_layout_names[][2] = { +static const char *const std_layout_names[][2] = { {"empty", ""}, // not in lavc {"mono", "fc"}, {"stereo", "fl-fr"}, @@ -105,7 +105,7 @@ static const struct mp_chmap default_layouts[MP_NUM_CHANNELS + 1] = { // channels. 3 and 7 channels were likely undefined (no ALSA support). // I'm not sure about the 4 channel case: ALSA uses "quad", while the ffmpeg // default layout is "4.0". -static const char *mplayer_layouts[MP_NUM_CHANNELS + 1] = { +static const char *const mplayer_layouts[MP_NUM_CHANNELS + 1] = { [1] = "mono", [2] = "stereo", [4] = "quad", diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c index f71a868674..160f1ce5fa 100644 --- a/audio/chmap_sel.c +++ b/audio/chmap_sel.c @@ -21,7 +21,7 @@ #include "common/common.h" #include "chmap_sel.h" -static struct mp_chmap speaker_replacements[][2] = { +static const struct mp_chmap speaker_replacements[][2] = { // 5.1 <-> 5.1 (side) { MP_CHMAP2(SL, SR), MP_CHMAP2(BL, BR) }, // 7.1 <-> 7.1 (rear ext) @@ -170,7 +170,7 @@ bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map) } for (int i = 0; i < MP_ARRAY_SIZE(speaker_replacements); i++) { struct mp_chmap t = *map; - struct mp_chmap *r = speaker_replacements[i]; + struct mp_chmap *r = (struct mp_chmap *)speaker_replacements[i]; if (replace_speakers(&t, r) && test_layout(s, &t)) { *map = t; return true; diff --git a/audio/filter/af.c b/audio/filter/af.c index d2c4bae40e..c69077e93f 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -31,34 +31,34 @@ #include "af.h" // Static list of filters -extern struct af_info af_info_dummy; -extern struct af_info af_info_delay; -extern struct af_info af_info_channels; -extern struct af_info af_info_format; -extern struct af_info af_info_force; -extern struct af_info af_info_volume; -extern struct af_info af_info_equalizer; -extern struct af_info af_info_pan; -extern struct af_info af_info_surround; -extern struct af_info af_info_sub; -extern struct af_info af_info_export; -extern struct af_info af_info_drc; -extern struct af_info af_info_extrastereo; -extern struct af_info af_info_lavcac3enc; -extern struct af_info af_info_lavrresample; -extern struct af_info af_info_sweep; -extern struct af_info af_info_hrtf; -extern struct af_info af_info_ladspa; -extern struct af_info af_info_center; -extern struct af_info af_info_sinesuppress; -extern struct af_info af_info_karaoke; -extern struct af_info af_info_scaletempo; -extern struct af_info af_info_bs2b; -extern struct af_info af_info_lavfi; -extern struct af_info af_info_convert24; -extern struct af_info af_info_convertsignendian; - -static struct af_info* filter_list[] = { +extern const struct af_info af_info_dummy; +extern const struct af_info af_info_delay; +extern const struct af_info af_info_channels; +extern const struct af_info af_info_format; +extern const struct af_info af_info_force; +extern const struct af_info af_info_volume; +extern const struct af_info af_info_equalizer; +extern const struct af_info af_info_pan; +extern const struct af_info af_info_surround; +extern const struct af_info af_info_sub; +extern const struct af_info af_info_export; +extern const struct af_info af_info_drc; +extern const struct af_info af_info_extrastereo; +extern const struct af_info af_info_lavcac3enc; +extern const struct af_info af_info_lavrresample; +extern const struct af_info af_info_sweep; +extern const struct af_info af_info_hrtf; +extern const struct af_info af_info_ladspa; +extern const struct af_info af_info_center; +extern const struct af_info af_info_sinesuppress; +extern const struct af_info af_info_karaoke; +extern const struct af_info af_info_scaletempo; +extern const struct af_info af_info_bs2b; +extern const struct af_info af_info_lavfi; +extern const struct af_info af_info_convert24; +extern const struct af_info af_info_convertsignendian; + +static const struct af_info *const filter_list[] = { &af_info_dummy, &af_info_delay, &af_info_channels, @@ -389,7 +389,7 @@ static char *af_find_conversion_filter(int srcfmt, int *dstfmt) } for (int n = 0; filter_list[n]; n++) { - struct af_info *af = filter_list[n]; + const struct af_info *af = filter_list[n]; if (!af->test_conversion) continue; for (int i = 0; af_fmtstr_table[i].format; i++) { @@ -589,7 +589,7 @@ void af_uninit(struct af_stream *s) struct af_stream *af_new(struct mpv_global *global) { struct af_stream *s = talloc_zero(NULL, struct af_stream); - static struct af_info in = { .name = "in" }; + static const struct af_info in = { .name = "in" }; s->first = talloc(s, struct af_instance); *s->first = (struct af_instance) { .info = &in, @@ -599,7 +599,7 @@ struct af_stream *af_new(struct mpv_global *global) .data = &s->input, .mul = 1.0, }; - static struct af_info out = { .name = "out" }; + static const struct af_info out = { .name = "out" }; s->last = talloc(s, struct af_instance); *s->last = (struct af_instance) { .info = &out, diff --git a/audio/filter/af_bs2b.c b/audio/filter/af_bs2b.c index 08d037bf4e..0a2bd8e552 100644 --- a/audio/filter/af_bs2b.c +++ b/audio/filter/af_bs2b.c @@ -189,7 +189,7 @@ static int af_open(struct af_instance *af) #define OPT_BASE_STRUCT struct af_bs2b /// Description of this filter -struct af_info af_info_bs2b = { +const struct af_info af_info_bs2b = { .info = "Bauer stereophonic-to-binaural audio filter", .name = "bs2b", .open = af_open, diff --git a/audio/filter/af_center.c b/audio/filter/af_center.c index 106e08412e..3039e50302 100644 --- a/audio/filter/af_center.c +++ b/audio/filter/af_center.c @@ -86,7 +86,7 @@ static int af_open(struct af_instance* af){ } #define OPT_BASE_STRUCT af_center_t -struct af_info af_info_center = { +const struct af_info af_info_center = { .info = "Audio filter for adding a center channel", .name = "center", .flags = AF_FLAGS_NOT_REENTRANT, diff --git a/audio/filter/af_channels.c b/audio/filter/af_channels.c index 118607b66f..83be68263e 100644 --- a/audio/filter/af_channels.c +++ b/audio/filter/af_channels.c @@ -238,7 +238,7 @@ static int af_open(struct af_instance* af){ } #define OPT_BASE_STRUCT af_channels_t -struct af_info af_info_channels = { +const struct af_info af_info_channels = { .info = "Insert or remove channels", .name = "channels", .open = af_open, diff --git a/audio/filter/af_convert24.c b/audio/filter/af_convert24.c index 6990fbd421..38799bd8fc 100644 --- a/audio/filter/af_convert24.c +++ b/audio/filter/af_convert24.c @@ -108,7 +108,7 @@ static int af_open(struct af_instance *af) return AF_OK; } -struct af_info af_info_convert24 = { +const struct af_info af_info_convert24 = { .info = "Convert between 24 and 32 bit sample format", .name = "convert24", .open = af_open, diff --git a/audio/filter/af_convertsignendian.c b/audio/filter/af_convertsignendian.c index 7bfaf0f978..45b365efd8 100644 --- a/audio/filter/af_convertsignendian.c +++ b/audio/filter/af_convertsignendian.c @@ -123,7 +123,7 @@ static int af_open(struct af_instance *af) return AF_OK; } -struct af_info af_info_convertsignendian = { +const struct af_info af_info_convertsignendian = { .info = "Convert between sample format sign/endian", .name = "convertsignendian", .open = af_open, diff --git a/audio/filter/af_delay.c b/audio/filter/af_delay.c index b16cdc1f63..56013b3270 100644 --- a/audio/filter/af_delay.c +++ b/audio/filter/af_delay.c @@ -178,7 +178,7 @@ static int af_open(struct af_instance* af){ } #define OPT_BASE_STRUCT af_delay_t -struct af_info af_info_delay = { +const struct af_info af_info_delay = { .info = "Delay audio filter", .name = "delay", .open = af_open, diff --git a/audio/filter/af_drc.c b/audio/filter/af_drc.c index 3bcd368d4d..94e161130f 100644 --- a/audio/filter/af_drc.c +++ b/audio/filter/af_drc.c @@ -313,7 +313,7 @@ static int af_open(struct af_instance* af){ } #define OPT_BASE_STRUCT af_drc_t -struct af_info af_info_drc = { +const struct af_info af_info_drc = { .info = "Dynamic range compression filter", .name = "drc", .flags = AF_FLAGS_NOT_REENTRANT, diff --git a/audio/filter/af_dummy.c b/audio/filter/af_dummy.c index d920480e01..61f2207d84 100644 --- a/audio/filter/af_dummy.c +++ b/audio/filter/af_dummy.c @@ -54,7 +54,7 @@ static int af_open(struct af_instance* af){ } // Description of this filter -struct af_info af_info_dummy = { +const struct af_info af_info_dummy = { .info = "dummy", .name = "dummy", .open = af_open, diff --git a/audio/filter/af_equalizer.c b/audio/filter/af_equalizer.c index 83fa80f2b3..4e96223ee7 100644 --- a/audio/filter/af_equalizer.c +++ b/audio/filter/af_equalizer.c @@ -194,7 +194,7 @@ static int af_open(struct af_instance* af){ } #define OPT_BASE_STRUCT af_equalizer_t -struct af_info af_info_equalizer = { +const struct af_info af_info_equalizer = { .info = "Equalizer audio filter", .name = "equalizer", .flags = AF_FLAGS_NOT_REENTRANT, diff --git a/audio/filter/af_export.c b/audio/filter/af_export.c index faa09bf927..9c3bab671a 100644 --- a/audio/filter/af_export.c +++ b/audio/filter/af_export.c @@ -222,7 +222,7 @@ static int af_open( struct af_instance* af ) } #define OPT_BASE_STRUCT af_export_t -struct af_info af_info_export = { +const struct af_info af_info_export = { .info = "Sound export filter", .name = "export", .open = af_open, diff --git a/audio/filter/af_extrastereo.c b/audio/filter/af_extrastereo.c index 05a1ac8e36..4ebe03a228 100644 --- a/audio/filter/af_extrastereo.c +++ b/audio/filter/af_extrastereo.c @@ -118,7 +118,7 @@ static int af_open(struct af_instance* af){ } #define OPT_BASE_STRUCT af_extrastereo_t -struct af_info af_info_extrastereo = { +const struct af_info af_info_extrastereo = { .info = "Increase difference between audio channels", .name = "extrastereo", .flags = AF_FLAGS_NOT_REENTRANT, diff --git a/audio/filter/af_format.c b/audio/filter/af_format.c index a51c543406..9183259bd9 100644 --- a/audio/filter/af_format.c +++ b/audio/filter/af_format.c @@ -114,7 +114,7 @@ static int af_open(struct af_instance *af) #define OPT_BASE_STRUCT struct priv -struct af_info af_info_format = { +const struct af_info af_info_format = { .info = "Force audio format", .name = "format", |