mirror of https://github.com/mpv-player/mpv
26f4f18c06
Change all OPT_* macros such that they don't define the entire m_option initializer, and instead expand only to a part of it, which sets certain fields. This requires changing almost every option declaration, because they all use these macros. A declaration now always starts with {"name", ... followed by designated initializers only (possibly wrapped in macros). The OPT_* macros now initialize the .offset and .type fields only, sometimes also .priv and others. I think this change makes the option macros less tricky. The old code had to stuff everything into macro arguments (and attempted to allow setting arbitrary fields by letting the user pass designated initializers in the vararg parts). Some of this was made messy due to C99 and C11 not allowing 0-sized varargs with ',' removal. It's also possible that this change is pointless, other than cosmetic preferences. Not too happy about some things. For example, the OPT_CHOICE() indentation I applied looks a bit ugly. Much of this change was done with regex search&replace, but some places required manual editing. In particular, code in "obscure" areas (which I didn't include in compilation) might be broken now. In wayland_common.c the author of some option declarations confused the flags parameter with the default value (though the default value was also properly set below). I fixed this with this change. |
||
---|---|---|
.. | ||
cookies.c | ||
cookies.h | ||
dvb_tune.c | ||
dvb_tune.h | ||
dvbin.h | ||
stream.c | ||
stream.h | ||
stream_avdevice.c | ||
stream_bluray.c | ||
stream_cb.c | ||
stream_cdda.c | ||
stream_concat.c | ||
stream_dvb.c | ||
stream_dvdnav.c | ||
stream_edl.c | ||
stream_file.c | ||
stream_lavf.c | ||
stream_libarchive.c | ||
stream_libarchive.h | ||
stream_memory.c | ||
stream_mf.c | ||
stream_null.c |