History

all: use designated initializers for AVOption.unit

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

Anton Khirnov committed 2 years ago

Commit 1e7d2001 parent 8a2c868338 files · +4684 −4684Browse files

Showing the changes to libavfilter/avfiltergraph.c (1 of 338 files). Show all

Unified · Split

libavfilter/avfiltergraph.c+2−2
@@ -47,10 +47,10 @@ · 46 unmodified lines
4747 #define A AV_OPT_FLAG_AUDIO_PARAM
4848 static const AVOption filtergraph_options[] = {
4949 { "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" },
5151 { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = F|V|A, .unit = "thread_type" },
5252 { "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"},
5454 {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags = F|V|A, .unit = "threads"},
5555 {"scale_sws_opts" , "default scale filter options" , OFFSET(scale_sws_opts) ,
5656 AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|V },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t