Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
Showing the changes to libavfilter/avfiltergraph.c (1 of 338 files). Show all
Unified · Split
| @@ -47,10 +47,10 @@ · 46 unmodified lines | |||
| 47 | #define A AV_OPT_FLAG_AUDIO_PARAM | 47 | #define A AV_OPT_FLAG_AUDIO_PARAM |
| 48 | static const AVOption filtergraph_options[] = { | 48 | static const AVOption filtergraph_options[] = { |
| 49 | { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, | 49 | { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, |
| 50 | { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, F|V|A, "thread_type" }, | 50 | { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, F|V|A, .unit = "thread_type" }, |
| 51 | { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = F|V|A, .unit = "thread_type" }, | 51 | { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = F|V|A, .unit = "thread_type" }, |
| 52 | { "threads", "Maximum number of threads", OFFSET(nb_threads), AV_OPT_TYPE_INT, | 52 | { "threads", "Maximum number of threads", OFFSET(nb_threads), AV_OPT_TYPE_INT, |
| 53 | { .i64 = 0 }, 0, INT_MAX, F|V|A, "threads"}, | 53 | { .i64 = 0 }, 0, INT_MAX, F|V|A, .unit = "threads"}, |
| 54 | {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags = F|V|A, .unit = "threads"}, | 54 | {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags = F|V|A, .unit = "threads"}, |
| 55 | {"scale_sws_opts" , "default scale filter options" , OFFSET(scale_sws_opts) , | 55 | {"scale_sws_opts" , "default scale filter options" , OFFSET(scale_sws_opts) , |
| 56 | AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|V }, | 56 | AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|V }, |