Address of dll imported variables can't be used for constant initialization in C language modes.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -56,23 +56,6 @@ enum { · 55 unmodified lines | ||
| 56 | 56 | TONE_MAP_COUNT, |
| 57 | 57 | }; |
| 58 | 58 | |
| 59 | −static const struct pl_tone_map_function * const tonemapping_funcs[TONE_MAP_COUNT] = { | |
| 60 | − [TONE_MAP_AUTO] = &pl_tone_map_auto, | |
| 61 | − [TONE_MAP_CLIP] = &pl_tone_map_clip, | |
| 62 | −#if PL_API_VER >= 246 | |
| 63 | − [TONE_MAP_ST2094_40] = &pl_tone_map_st2094_40, | |
| 64 | − [TONE_MAP_ST2094_10] = &pl_tone_map_st2094_10, | |
| 65 | −#endif | |
| 66 | − [TONE_MAP_BT2390] = &pl_tone_map_bt2390, | |
| 67 | − [TONE_MAP_BT2446A] = &pl_tone_map_bt2446a, | |
| 68 | − [TONE_MAP_SPLINE] = &pl_tone_map_spline, | |
| 69 | − [TONE_MAP_REINHARD] = &pl_tone_map_reinhard, | |
| 70 | − [TONE_MAP_MOBIUS] = &pl_tone_map_mobius, | |
| 71 | − [TONE_MAP_HABLE] = &pl_tone_map_hable, | |
| 72 | − [TONE_MAP_GAMMA] = &pl_tone_map_gamma, | |
| 73 | − [TONE_MAP_LINEAR] = &pl_tone_map_linear, | |
| 74 | −}; | |
| 75 | − | |
| 76 | 59 | static const char *const var_names[] = { |
| 77 | 60 | "in_w", "iw", ///< width of the input video frame |
| 78 | 61 | "in_h", "ih", ///< height of the input video frame |
| @@ -269,6 +252,26 @@ static void pl_av_log(void *log_ctx, enum pl_log_level level, const char *msg) · 190 unmodified lines | ||
| 269 | 252 | av_log(log_ctx, av_lev, "%s\n", msg); |
| 270 | 253 | } |
| 271 | 254 | |
| 255 | +static const struct pl_tone_map_function *pl_get_tonemapping_func(int tm) { | |
| 256 | + switch (tm) { | |
| 257 | + case TONE_MAP_AUTO: return &pl_tone_map_auto; | |
| 258 | + case TONE_MAP_CLIP: return &pl_tone_map_clip; | |
| 259 | +#if PL_API_VER >= 246 | |
| 260 | + case TONE_MAP_ST2094_40: return &pl_tone_map_st2094_40; | |
| 261 | + case TONE_MAP_ST2094_10: return &pl_tone_map_st2094_10; | |
| 262 | +#endif | |
| 263 | + case TONE_MAP_BT2390: return &pl_tone_map_bt2390; | |
| 264 | + case TONE_MAP_BT2446A: return &pl_tone_map_bt2446a; | |
| 265 | + case TONE_MAP_SPLINE: return &pl_tone_map_spline; | |
| 266 | + case TONE_MAP_REINHARD: return &pl_tone_map_reinhard; | |
| 267 | + case TONE_MAP_MOBIUS: return &pl_tone_map_mobius; | |
| 268 | + case TONE_MAP_HABLE: return &pl_tone_map_hable; | |
| 269 | + case TONE_MAP_GAMMA: return &pl_tone_map_gamma; | |
| 270 | + case TONE_MAP_LINEAR: return &pl_tone_map_linear; | |
| 271 | + default: av_assert0(0); | |
| 272 | + } | |
| 273 | +} | |
| 274 | + | |
| 272 | 275 | static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len) |
| 273 | 276 | { |
| 274 | 277 | LibplaceboContext *s = avctx->priv; |
| @@ -365,7 +368,7 @@ static int update_settings(AVFilterContext *ctx) · 90 unmodified lines | ||
| 365 | 368 | s->color_map_params = *pl_color_map_params( |
| 366 | 369 | .intent = s->intent, |
| 367 | 370 | .gamut_mode = gamut_mode, |
| 368 | − .tone_mapping_function = tonemapping_funcs[s->tonemapping], | |
| 371 | + .tone_mapping_function = pl_get_tonemapping_func(s->tonemapping), | |
| 369 | 372 | .tone_mapping_param = s->tonemapping_param, |
| 370 | 373 | .tone_mapping_mode = tonemapping_mode, |
| 371 | 374 | .inverse_tone_mapping = s->inverse_tonemapping, |