History

avfilter/vsrc_testsrc: Deduplicate options

Andreas Rheinhardt committed 5 years ago

Commit 482aeda1 parent 6fed8a61 file · +5 −10Browse files

Unified · Split

libavfilter/vsrc_testsrc.c+5−10
@@ -99,6 +99,9 @@ typedef struct TestSourceContext { · 98 unmodified lines
9999
100100 #define COMMON_OPTIONS SIZE_OPTIONS COMMON_OPTIONS_NOSIZE
101101
102+#define NOSIZE_OPTIONS_OFFSET 2
103+/* Filters using COMMON_OPTIONS_NOSIZE also use the following options
104+ * via &options[NOSIZE_OPTIONS_OFFSET]. So don't break it. */
102105 static const AVOption options[] = {
103106 COMMON_OPTIONS
104107 { NULL }
@@ -1653,11 +1656,7 @@ AVFilter ff_vsrc_smptehdbars = { · 1548 unmodified lines
16531656
16541657 #if CONFIG_ALLYUV_FILTER
16551658
1656−static const AVOption allyuv_options[] = {
1657− COMMON_OPTIONS_NOSIZE
1658− { NULL }
1659−};
1660−
1659+#define allyuv_options &options[NOSIZE_OPTIONS_OFFSET]
16611660 AVFILTER_DEFINE_CLASS(allyuv);
16621661
16631662 static void allyuv_fill_picture(AVFilterContext *ctx, AVFrame *frame)
@@ -1734,11 +1733,7 @@ AVFilter ff_vsrc_allyuv = { · 70 unmodified lines
17341733
17351734 #if CONFIG_ALLRGB_FILTER
17361735
1737−static const AVOption allrgb_options[] = {
1738− COMMON_OPTIONS_NOSIZE
1739− { NULL }
1740−};
1741−
1736+#define allrgb_options &options[NOSIZE_OPTIONS_OFFSET]
17421737 AVFILTER_DEFINE_CLASS(allrgb);
17431738
17441739 static void allrgb_fill_picture(AVFilterContext *ctx, AVFrame *frame)

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