diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-07-16 13:28:28 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-03 21:59:54 +0100 |
commit | 37388ebb0ef9085c841d7f94e665a5a77cfe0e92 (patch) | |
tree | b47d18bee4e7f661d9e6d794dac0ec1cebcd3a37 /mpvcore | |
parent | 891a2a1f474add323145e6b2cd2d29181830e4a4 (diff) | |
download | mpv-37388ebb0ef9085c841d7f94e665a5a77cfe0e92.tar.bz2 mpv-37388ebb0ef9085c841d7f94e665a5a77cfe0e92.tar.xz |
configure: uniform the defines to #define HAVE_xxx (0|1)
The configure followed 5 different convetions of defines because the next guy
always wanted to introduce a new better way to uniform it[1]. For an
hypothetic feature 'hurr' you could have had:
* #define HAVE_HURR 1 / #undef HAVE_DURR
* #define HAVE_HURR / #undef HAVE_DURR
* #define CONFIG_HURR 1 / #undef CONFIG_DURR
* #define HAVE_HURR 1 / #define HAVE_DURR 0
* #define CONFIG_HURR 1 / #define CONFIG_DURR 0
All is now uniform and uses:
* #define HAVE_HURR 1
* #define HAVE_DURR 0
We like definining to 0 as opposed to `undef` bcause it can help spot typos
and is very helpful when doing big reorganizations in the code.
[1]: http://xkcd.com/927/ related
Diffstat (limited to 'mpvcore')
-rw-r--r-- | mpvcore/av_log.c | 18 | ||||
-rw-r--r-- | mpvcore/charset_conv.c | 16 | ||||
-rw-r--r-- | mpvcore/input/input.c | 20 | ||||
-rw-r--r-- | mpvcore/options.c | 76 | ||||
-rw-r--r-- | mpvcore/path.c | 2 | ||||
-rw-r--r-- | mpvcore/player/command.c | 58 | ||||
-rw-r--r-- | mpvcore/player/configfiles.c | 4 | ||||
-rw-r--r-- | mpvcore/player/loadfile.c | 24 | ||||
-rw-r--r-- | mpvcore/player/main.c | 30 | ||||
-rw-r--r-- | mpvcore/player/mp_lua.c | 6 | ||||
-rw-r--r-- | mpvcore/player/osd.c | 2 | ||||
-rw-r--r-- | mpvcore/player/playloop.c | 4 | ||||
-rw-r--r-- | mpvcore/player/sub.c | 2 | ||||
-rw-r--r-- | mpvcore/player/video.c | 2 |
14 files changed, 132 insertions, 132 deletions
diff --git a/mpvcore/av_log.c b/mpvcore/av_log.c index 9fa6fc93ae..ca3ef70747 100644 --- a/mpvcore/av_log.c +++ b/mpvcore/av_log.c @@ -33,18 +33,18 @@ #include <libavformat/avformat.h> #include <libswscale/swscale.h> -#ifdef CONFIG_LIBAVDEVICE +#if HAVE_LIBAVDEVICE #include <libavdevice/avdevice.h> #endif -#ifdef CONFIG_LIBAVFILTER +#if HAVE_LIBAVFILTER #include <libavfilter/avfilter.h> #endif -#ifdef CONFIG_LIBAVRESAMPLE +#if HAVE_LIBAVRESAMPLE #include <libavresample/avresample.h> #endif -#ifdef CONFIG_LIBSWRESAMPLE +#if HAVE_LIBSWRESAMPLE #include <libswresample/swresample.h> #endif @@ -138,10 +138,10 @@ void init_libav(void) av_register_all(); avformat_network_init(); -#ifdef CONFIG_LIBAVFILTER +#if HAVE_LIBAVFILTER avfilter_register_all(); #endif -#ifdef CONFIG_LIBAVDEVICE +#if HAVE_LIBAVDEVICE avdevice_register_all(); #endif } @@ -164,13 +164,13 @@ void print_libav_versions(int v) print_version(v, "libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version()); print_version(v, "libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()); print_version(v, "libswscale", LIBSWSCALE_VERSION_INT, swscale_version()); -#ifdef CONFIG_LIBAVFILTER +#if HAVE_LIBAVFILTER print_version(v, "libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version()); #endif -#ifdef CONFIG_LIBAVRESAMPLE +#if HAVE_LIBAVRESAMPLE print_version(v, "libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version()); #endif -#ifdef CONFIG_LIBSWRESAMPLE +#if HAVE_LIBSWRESAMPLE print_version(v, "libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version()); #endif } diff --git a/mpvcore/charset_conv.c b/mpvcore/charset_conv.c index a5c7f559ad..3a6ff67330 100644 --- a/mpvcore/charset_conv.c +++ b/mpvcore/charset_conv.c @@ -27,15 +27,15 @@ #include "mpvcore/mp_msg.h" -#ifdef CONFIG_ENCA +#if HAVE_ENCA #include <enca.h> #endif -#ifdef CONFIG_LIBGUESS +#if HAVE_LIBGUESS #include <libguess.h> #endif -#ifdef CONFIG_ICONV +#if HAVE_ICONV #include <iconv.h> #endif @@ -85,7 +85,7 @@ bool mp_charset_requires_guess(const char *user_cp) (r > 1 && bstrcasecmp0(res[0], "utf8") == 0); } -#ifdef CONFIG_ENCA +#if HAVE_ENCA static const char *enca_guess(bstr buf, const char *language) { if (!language || !language[0]) @@ -117,7 +117,7 @@ static const char *enca_guess(bstr buf, const char *language) } #endif -#ifdef CONFIG_LIBGUESS +#if HAVE_LIBGUESS static const char *libguess_guess(bstr buf, const char *language) { if (!language || !language[0] || strcmp(language, "help") == 0) { @@ -157,11 +157,11 @@ const char *mp_charset_guess(bstr buf, const char *user_cp, int flags) const char *res = NULL; -#ifdef CONFIG_ENCA +#if HAVE_ENCA if (bstrcasecmp0(type, "enca") == 0) res = enca_guess(buf, lang); #endif -#ifdef CONFIG_LIBGUESS +#if HAVE_LIBGUESS if (bstrcasecmp0(type, "guess") == 0) res = libguess_guess(buf, lang); #endif @@ -212,7 +212,7 @@ bstr mp_charset_guess_and_conv_to_utf8(bstr buf, const char *user_cp, int flags) // returns: buf (no conversion), .start==NULL (error), or allocated buffer bstr mp_iconv_to_utf8(bstr buf, const char *cp, int flags) { -#ifdef CONFIG_ICONV +#if HAVE_ICONV if (!cp || !cp[0] || mp_charset_is_utf8(cp)) return buf; diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index e9c628dedb..12a30dd848 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -53,15 +53,15 @@ #include "joystick.h" -#ifdef CONFIG_LIRC +#if HAVE_LIRC #include "lirc.h" #endif -#ifdef CONFIG_LIRCC +#if HAVE_LIRCC #include <lirc/lircc.h> #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA #include "osdep/macosx_events.h" #endif @@ -616,7 +616,7 @@ const m_option_t mp_input_opts[] = { OPT_FLAG("joystick", input.use_joystick, CONF_GLOBAL), OPT_FLAG("lirc", input.use_lirc, CONF_GLOBAL), OPT_FLAG("lircc", input.use_lircc, CONF_GLOBAL), -#ifdef CONFIG_COCOA +#if HAVE_COCOA OPT_FLAG("ar", input.use_ar, CONF_GLOBAL), OPT_FLAG("media-keys", input.use_media_keys, CONF_GLOBAL), #endif @@ -1734,7 +1734,7 @@ static void remove_dead_fds(struct input_ctx *ictx) } } -#ifdef HAVE_POSIX_SELECT +#if HAVE_POSIX_SELECT static void input_wait_read(struct input_ctx *ictx, int time) { @@ -2310,7 +2310,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) "input config\n"); } -#ifdef CONFIG_JOYSTICK +#if HAVE_JOYSTICK if (input_conf->use_joystick) { int fd = mp_input_joystick_init(input_conf->js_dev); if (fd < 0) @@ -2321,7 +2321,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif -#ifdef CONFIG_LIRC +#if HAVE_LIRC if (input_conf->use_lirc) { int fd = mp_input_lirc_init(); if (fd > 0) @@ -2330,7 +2330,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif -#ifdef CONFIG_LIRCC +#if HAVE_LIRCC if (input_conf->use_lircc) { int fd = lircc_init("mpv", NULL); if (fd >= 0) @@ -2338,7 +2338,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA if (input_conf->use_ar) { cocoa_init_apple_remote(); ictx->using_ar = true; @@ -2386,7 +2386,7 @@ void mp_input_uninit(struct input_ctx *ictx) if (!ictx) return; -#ifdef CONFIG_COCOA +#if HAVE_COCOA if (ictx->using_ar) { cocoa_uninit_apple_remote(); } diff --git a/mpvcore/options.c b/mpvcore/options.c index 44f821db75..3d65ec337e 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -72,7 +72,7 @@ static int print_version_opt(const m_option_t *opt, const char *name, exit(0); } -#ifdef CONFIG_RADIO +#if HAVE_RADIO static const m_option_t radioopts_conf[]={ {"device", &stream_radio_defaults.device, CONF_TYPE_STRING, 0, 0 ,0, NULL}, {"driver", &stream_radio_defaults.driver, CONF_TYPE_STRING, 0, 0 ,0, NULL}, @@ -83,9 +83,9 @@ static const m_option_t radioopts_conf[]={ {"achannels", &stream_radio_defaults.achannels, CONF_TYPE_INT, CONF_MIN, 0 ,0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; -#endif /* CONFIG_RADIO */ +#endif /* HAVE_RADIO */ -#ifdef CONFIG_TV +#if HAVE_TV static const m_option_t tvopts_conf[]={ {"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, {"audio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 1, 0, NULL}, @@ -97,7 +97,7 @@ static const m_option_t tvopts_conf[]={ {"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, -#if defined(CONFIG_TV_V4L2) +#if HAVE_TV_V4L2 {"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL}, #endif {"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL}, @@ -111,7 +111,7 @@ static const m_option_t tvopts_conf[]={ {"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, {"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, {"gain", &stream_tv_defaults.gain, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL}, -#if defined(CONFIG_TV_V4L2) +#if HAVE_TV_V4L2 {"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, {"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, {"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, @@ -123,15 +123,15 @@ static const m_option_t tvopts_conf[]={ {"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL}, {"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, -#ifdef CONFIG_ALSA +#if HAVE_ALSA {"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL}, -#endif /* CONFIG_ALSA */ -#endif /* defined(CONFIG_TV_V4L2) */ +#endif /* HAVE_ALSA */ +#endif /* HAVE_TV_V4L2 */ {"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; -#endif /* CONFIG_TV */ +#endif /* HAVE_TV */ extern int pvr_param_aspect_ratio; extern int pvr_param_sample_rate; @@ -143,7 +143,7 @@ extern char *pvr_param_bitrate_mode; extern int pvr_param_bitrate_peak; extern char *pvr_param_stream_type; -#ifdef CONFIG_PVR +#if HAVE_PVR static const m_option_t pvropts_conf[]={ {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL}, {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL}, @@ -156,7 +156,7 @@ static const m_option_t pvropts_conf[]={ {"fmt", &pvr_param_stream_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ extern const m_option_t dvbin_opts_conf[]; extern const m_option_t lavfdopts_conf[]; @@ -290,7 +290,7 @@ static const m_option_t msgl_config[]={ }; -#ifdef CONFIG_TV +#if HAVE_TV static const m_option_t tvscan_conf[]={ {"autostart", &stream_tv_defaults.scan, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"threshold", &stream_tv_defaults.scan_threshold, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL}, @@ -340,20 +340,20 @@ const m_option_t mp_opts[] = { {"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, {"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL | CONF_PRE_PARSE, 0, 1, NULL}, {"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, -#ifdef CONFIG_PRIORITY +#if HAVE_PRIORITY {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif OPT_FLAG("config", load_config, CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE), OPT_STRINGLIST("reset-on-next-file", reset_options, CONF_GLOBAL), -#ifdef CONFIG_LUA +#if HAVE_LUA OPT_STRINGLIST("lua", lua_files, CONF_GLOBAL), OPT_FLAG("osc", lua_load_osc, CONF_GLOBAL), #endif // ------------------------- stream options -------------------- -#ifdef CONFIG_STREAM_CACHE +#if HAVE_STREAM_CACHE OPT_CHOICE_OR_INT("cache", stream_cache_size, 0, 32, 0x7fffffff, ({"no", 0}, {"auto", -1}), @@ -365,20 +365,20 @@ const m_option_t mp_opts[] = { OPT_FLOATRANGE("cache-seek-min", stream_cache_seek_min_percent, 0, 0, 99), OPT_CHOICE_OR_INT("cache-pause", stream_cache_pause, 0, 0, 40, ({"no", -1})), -#endif /* CONFIG_STREAM_CACHE */ +#endif /* HAVE_STREAM_CACHE */ {"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD {"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"dvd-speed", &dvd_speed, CONF_TYPE_INT, 0, 0, 0, NULL}, {"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL}, -#endif /* CONFIG_DVDREAD */ +#endif /* HAVE_DVDREAD */ OPT_INTPAIR("chapter", chapterrange, 0), OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190, ({"auto", -1})), -#ifdef CONFIG_LIBBLURAY +#if HAVE_LIBBLURAY {"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, -#endif /* CONFIG_LIBBLURAY */ +#endif /* HAVE_LIBBLURAY */ {"http-header-fields", &network_http_header_fields, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, {"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL}, @@ -426,7 +426,7 @@ const m_option_t mp_opts[] = { OPT_STRING("quvi-format", quvi_format, 0), -#ifdef CONFIG_CDDA +#if HAVE_CDDA { "cdda", (void *)&cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif @@ -438,16 +438,16 @@ const m_option_t mp_opts[] = { OPT_STRING("sub-demuxer", sub_demuxer_name, 0), {"mf", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL}, -#ifdef CONFIG_RADIO +#if HAVE_RADIO {"radio", (void *) radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_RADIO */ -#ifdef CONFIG_TV +#endif /* HAVE_RADIO */ +#if HAVE_TV {"tv", (void *) tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_TV */ -#ifdef CONFIG_PVR +#endif /* HAVE_TV */ +#if HAVE_PVR {"pvr", (void *) pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_PVR */ -#ifdef CONFIG_DVBIN +#endif /* HAVE_PVR */ +#if HAVE_DVBIN {"dvbin", (void *) dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif @@ -494,7 +494,7 @@ const m_option_t mp_opts[] = { // postprocessing: OPT_INT("pp", divx_quality, 0), -#ifdef CONFIG_LIBPOSTPROC +#if HAVE_LIBPOSTPROC {"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL}, #endif @@ -633,7 +633,7 @@ const m_option_t mp_opts[] = { OPT_FLAG("stop-screensaver", stop_screensaver, 0), OPT_INT64("wid", vo.WinID, CONF_GLOBAL), -#ifdef CONFIG_X11 +#if HAVE_X11 OPT_STRINGLIST("fstype", vo.fstype_list, 0), #endif OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0), @@ -645,7 +645,7 @@ const m_option_t mp_opts[] = { OPT_CHOICE_OR_INT("fs-screen", vo.fsscreen_id, 0, 0, 32, ({"all", -2}, {"current", -1})), -#ifdef CONFIG_COCOA +#if HAVE_COCOA OPT_FLAG("native-fs", vo.native_fs, 0), #endif @@ -677,7 +677,7 @@ const m_option_t mp_opts[] = { OPT_STRING("stream-capture", stream_capture, 0), OPT_STRING("stream-dump", stream_dump, 0), -#ifdef CONFIG_LIRC +#if HAVE_LIRC {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif @@ -724,9 +724,9 @@ const m_option_t mp_opts[] = { OPT_INTRANGE("key-fifo-size", input.key_fifo_size, CONF_GLOBAL, 2, 65000), OPT_FLAG("consolecontrols", consolecontrols, CONF_GLOBAL), OPT_FLAG("mouse-movements", vo.enable_mouse_movements, CONF_GLOBAL), -#ifdef CONFIG_TV +#if HAVE_TV {"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif /* CONFIG_TV */ +#endif /* HAVE_TV */ {"screenshot", (void *) screenshot_conf, CONF_TYPE_SUBCONFIG}, @@ -739,7 +739,7 @@ const m_option_t mp_opts[] = { {"version", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE}, {"V", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE}, -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING OPT_STRING("o", encode_output.file, CONF_GLOBAL), OPT_STRING("of", encode_output.format, CONF_GLOBAL), OPT_STRINGLIST("ofopts*", encode_output.fopts, CONF_GLOBAL), @@ -836,7 +836,7 @@ const struct MPOpts mp_default_opts = { .field_dominance = -1, .sub_auto = 1, .osd_bar_visible = 1, -#ifdef CONFIG_ASS +#if HAVE_LIBASS .ass_enabled = 1, #endif .sub_scale = 1, @@ -847,7 +847,7 @@ const struct MPOpts mp_default_opts = { .ass_shaper = 1, .use_embedded_fonts = 1, .suboverlap_enabled = 0, -#ifdef CONFIG_ENCA +#if HAVE_ENCA .sub_cp = "enca", #else .sub_cp = "UTF-8:UTF-8-BROKEN", @@ -875,7 +875,7 @@ const struct MPOpts mp_default_opts = { .use_joystick = 1, .use_lirc = 1, .use_lircc = 1, -#ifdef CONFIG_COCOA +#if HAVE_COCOA .use_ar = 1, .use_media_keys = 1, #endif diff --git a/mpvcore/path.c b/mpvcore/path.c index 93e2d09b04..df138489d6 100644 --- a/mpvcore/path.c +++ b/mpvcore/path.c @@ -42,7 +42,7 @@ typedef char *(*lookup_fun)(const char *); static const lookup_fun config_lookup_functions[] = { mp_find_user_config_file, -#ifdef CONFIG_COCOA +#if HAVE_COCOA mp_get_macosx_bundled_path, #endif mp_find_global_config_file, diff --git a/mpvcore/player/command.c b/mpvcore/player/command.c index bacc37aa27..05369470ff 100644 --- a/mpvcore/player/command.c +++ b/mpvcore/player/command.c @@ -56,11 +56,11 @@ #include "stream/tv.h" #include "stream/stream_radio.h" #include "stream/pvr.h" -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN #include "stream/dvbin.h" #endif #include "screenshot.h" -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H #include <sys/mman.h> #endif @@ -1137,11 +1137,11 @@ static int mp_property_fullscreen(m_option_t *prop, #define VF_DEINTERLACE_LABEL "deinterlace" static const char *deint_filters[] = { -#ifdef CONFIG_VF_LAVFI +#if HAVE_VF_LAVFI "lavfi=yadif", #endif "yadif", -#if CONFIG_VAAPI_VPP +#if HAVE_VAAPI_VPP "vavpp", #endif NULL @@ -1608,7 +1608,7 @@ static int mp_property_sub_pos(m_option_t *prop, int action, void *arg, return property_osd_helper(prop, action, arg, mpctx); } -#ifdef CONFIG_TV +#if HAVE_TV static tvi_handle_t *get_tvh(struct MPContext *mpctx) { @@ -1955,7 +1955,7 @@ static const m_option_t mp_properties[] = { M_OPTION_PROPERTY_CUSTOM("sub-visibility", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("sub-forced-only", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("sub-scale", property_osd_helper), -#ifdef CONFIG_ASS +#if HAVE_LIBASS M_OPTION_PROPERTY_CUSTOM("ass-use-margins", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("ass-vsfilter-aspect-compat", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("ass-style-override", property_osd_helper), @@ -1964,7 +1964,7 @@ static const m_option_t mp_properties[] = { M_OPTION_PROPERTY_CUSTOM("vf*", mp_property_vf), M_OPTION_PROPERTY_CUSTOM("af*", mp_property_af), -#ifdef CONFIG_TV +#if HAVE_TV { "tv-brightness", mp_property_tv_color, CONF_TYPE_INT, M_OPT_RANGE, -100, 100, .offset = TV_COLOR_BRIGHTNESS }, { "tv-contrast", mp_property_tv_color, CONF_TYPE_INT, @@ -2071,7 +2071,7 @@ static struct property_osd_display { { "ass-style-override", _("ASS subtitle style override")}, { "vf*", _("Video filters"), .msg = "Video filters:\n${vf}"}, { "af*", _("Audio filters"), .msg = "Audio filters:\n${af}"}, -#ifdef CONFIG_TV +#if HAVE_TV { "tv-brightness", _("Brightness"), .osd_progbar = OSD_BRIGHTNESS }, { "tv-hue", _("Hue"), .osd_progbar = OSD_HUE}, { "tv-saturation", _("Saturation"), .osd_progbar = OSD_SATURATION }, @@ -2272,7 +2272,7 @@ static int edit_filters_osd(struct MPContext *mpctx, enum stream_type mediatype, return r; } -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H static int ext2_sub_find(struct MPContext *mpctx, int id) { @@ -2723,7 +2723,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) (bar_osd ? OSD_SEEK_INFO_BAR : 0); break; -#ifdef CONFIG_RADIO +#if HAVE_RADIO case MP_CMD_RADIO_STEP_CHANNEL: if (mpctx->stream && mpctx->stream->type == STREAMTYPE_RADIO) { int v = cmd->args[0].v.i; @@ -2761,7 +2761,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) break; #endif -#ifdef CONFIG_TV +#if HAVE_TV case MP_CMD_TV_START_SCAN: if (get_tvh(mpctx)) tv_start_scan(get_tvh(mpctx), 1); @@ -2769,27 +2769,27 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_TV_SET_FREQ: if (get_tvh(mpctx)) tv_set_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0); -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_freq(mpctx->stream, ROUND(cmd->args[0].v.f)); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s", pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; case MP_CMD_TV_STEP_FREQ: if (get_tvh(mpctx)) tv_step_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0); -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_force_freq_step(mpctx->stream, ROUND(cmd->args[0].v.f)); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: f %d", pvr_get_current_channelname(mpctx->stream), pvr_get_current_frequency(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; case MP_CMD_TV_SET_NORM: @@ -2810,7 +2810,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) "Channel: %s", tv_channel_current->name); } } -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel_step(mpctx->stream, cmd->args[0].v.i); @@ -2818,8 +2818,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ -#ifdef CONFIG_DVBIN +#endif /* HAVE_PVR */ +#if HAVE_DVBIN if (mpctx->stream->type == STREAMTYPE_DVB) { int dir; int v = cmd->args[0].v.i; @@ -2836,7 +2836,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) mpctx->dvbin_reopen = 1; } } -#endif /* CONFIG_DVBIN */ +#endif /* HAVE_DVBIN */ break; case MP_CMD_TV_SET_CHANNEL: @@ -2847,17 +2847,17 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) "Channel: %s", tv_channel_current->name); } } -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel(mpctx->stream, cmd->args[0].v.s); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s", pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN case MP_CMD_DVB_SET_CHANNEL: if (mpctx->stream->type == STREAMTYPE_DVB) { mpctx->last_dvb_step = 1; @@ -2869,7 +2869,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) } } break; -#endif /* CONFIG_DVBIN */ +#endif /* HAVE_DVBIN */ case MP_CMD_TV_LAST_CHANNEL: if (get_tvh(mpctx)) { @@ -2879,14 +2879,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) "Channel: %s", tv_channel_current->name); } } -#ifdef CONFIG_PVR +#if HAVE_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_lastchannel(mpctx->stream); set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s", pvr_get_current_channelname(mpctx->stream), pvr_get_current_stationname(mpctx->stream)); } -#endif /* CONFIG_PVR */ +#endif /* HAVE_PVR */ break; case MP_CMD_TV_STEP_NORM: @@ -2898,7 +2898,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (get_tvh(mpctx)) tv_step_chanlist(get_tvh(mpctx)); break; -#endif /* CONFIG_TV */ +#endif /* HAVE_TV */ case MP_CMD_SUB_ADD: mp_add_subtitles(mpctx, cmd->args[0].v.s); @@ -2978,14 +2978,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_SCRIPT_DISPATCH: if (mpctx->lua_ctx) { -#ifdef CONFIG_LUA +#if HAVE_LUA mp_lua_script_dispatch(mpctx, cmd->args[0].v.s, cmd->args[1].v.i, cmd->key_up_follows ? "keyup_follows" : "press"); #endif } break; -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H case MP_CMD_OVERLAY_ADD: overlay_add(mpctx, cmd->args[0].v.i, cmd->args[1].v.i, cmd->args[2].v.i, @@ -3052,7 +3052,7 @@ void mp_notify(struct MPContext *mpctx, enum mp_event event, void *arg) static void handle_script_event(struct MPContext *mpctx, const char *name, const char *arg) { -#ifdef CONFIG_LUA +#if HAVE_LUA mp_lua_event(mpctx, name, arg); #endif } diff --git a/mpvcore/player/configfiles.c b/mpvcore/player/configfiles.c index 1c75231365..29350c0aed 100644 --- a/mpvcore/player/configfiles.c +++ b/mpvcore/player/configfiles.c @@ -202,11 +202,11 @@ char *mp_get_playback_resume_config_filename(const char *fname, goto exit; realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname)); } -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD if (bstr_startswith0(bfname, "dvd://")) realpath = talloc_asprintf(tmp, "%s - %s", realpath, dvd_device); #endif -#ifdef CONFIG_LIBBLURAY +#if HAVE_LIBBLURAY if (bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") || bstr_startswith0(bfname, "bluray://")) realpath = talloc_asprintf(tmp, "%s - %s", realpath, bluray_device); diff --git a/mpvcore/player/loadfile.c b/mpvcore/player/loadfile.c index 876994ac93..24b81934ad 100644 --- a/mpvcore/player/loadfile.c +++ b/mpvcore/player/loadfile.c @@ -56,7 +56,7 @@ #include "mp_core.h" #include "command.h" -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN #include "stream/dvbin.h" #endif @@ -85,7 +85,7 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask) if (mask & INITIALIZED_LIBASS) { mpctx->initialized_flags &= ~INITIALIZED_LIBASS; -#ifdef CONFIG_ASS +#if HAVE_LIBASS if (mpctx->osd->ass_renderer) ass_renderer_done(mpctx->osd->ass_renderer); mpctx->osd->ass_renderer = NULL; @@ -472,7 +472,7 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer) static void add_dvd_tracks(struct MPContext *mpctx) { -#ifdef CONFIG_DVDREAD +#if HAVE_DVDREAD struct demuxer *demuxer = mpctx->demuxer; struct stream *stream = demuxer->stream; struct stream_dvd_info_req info; @@ -818,7 +818,7 @@ static bool attachment_is_font(struct demux_attachment *att) static void add_subtitle_fonts_from_sources(struct MPContext *mpctx) { -#ifdef CONFIG_ASS +#if HAVE_LIBASS if (mpctx->opts->ass_enabled) { for (int j = 0; j < mpctx->num_sources; j++) { struct demuxer *d = mpctx->sources[j]; @@ -835,7 +835,7 @@ static void add_subtitle_fonts_from_sources(struct MPContext *mpctx) static void init_sub_renderer(struct MPContext *mpctx) { -#ifdef CONFIG_ASS +#if HAVE_LIBASS assert(!(mpctx->initialized_flags & INITIALIZED_LIBASS)); assert(!mpctx->osd->ass_renderer); @@ -853,7 +853,7 @@ static struct mp_resolve_result *resolve_url(const char *filename, { if (!mp_is_url(bstr0(filename))) return NULL; -#if defined(CONFIG_LIBQUVI) || defined(CONFIG_LIBQUVI9) +#if HAVE_LIBQUVI4 || HAVE_LIBQUVI9 return mp_resolve_quvi(filename, opts); #else return NULL; @@ -979,7 +979,7 @@ static void play_current_file(struct MPContext *mpctx) if (!mpctx->filename) goto terminate_playback; -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING encode_lavc_discontinuity(mpctx->encode_lavc_ctx); #endif @@ -1026,7 +1026,7 @@ static void play_current_file(struct MPContext *mpctx) MP_DBG(mpctx, "\n[[[init getch2]]]\n"); } -#ifdef CONFIG_ASS +#if HAVE_LIBASS if (opts->ass_style_override) ass_set_style_overrides(mpctx->ass_library, opts->ass_force_style_list); #endif @@ -1077,7 +1077,7 @@ static void play_current_file(struct MPContext *mpctx) stream_set_capture_file(mpctx->stream, opts->stream_capture); -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN goto_reopen_demuxer: ; #endif @@ -1164,7 +1164,7 @@ goto_reopen_demuxer: ; preselect_demux_streams(mpctx); -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_VIDEO]) encode_lavc_expect_stream(mpctx->encode_lavc_ctx, AVMEDIA_TYPE_VIDEO); if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_AUDIO]) @@ -1186,7 +1186,7 @@ goto_reopen_demuxer: ; if (!mpctx->sh_video && !mpctx->sh_audio) { MP_FATAL(mpctx, "No video or audio streams selected.\n"); -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN if (mpctx->stream->type == STREAMTYPE_DVB) { int dir; int v = mpctx->last_dvb_step; @@ -1262,7 +1262,7 @@ goto_reopen_demuxer: ; MP_VERBOSE(mpctx, "EOF code: %d \n", mpctx->stop_play); -#ifdef CONFIG_DVBIN +#if HAVE_DVBIN if (mpctx->dvbin_reopen) { mpctx->stop_play = 0; uninit_player(mpctx, INITIALIZED_ALL - (INITIALIZED_STREAM | INITIALIZED_GETCH2 | (opts->fixed_vo ? INITIALIZED_VO : 0))); diff --git a/mpvcore/player/main.c b/mpvcore/player/main.c index e425b7c051..34383f4264 100644 --- a/mpvcore/player/main.c +++ b/mpvcore/player/main.c @@ -64,11 +64,11 @@ #include "command.h" #include "screenshot.h" -#ifdef CONFIG_X11 +#if HAVE_X11 #include "video/out/x11_common.h" #endif -#ifdef CONFIG_COCOA +#if HAVE_COCOA #include "osdep/macosx_application.h" #endif @@ -109,14 +109,14 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, int rc; uninit_player(mpctx, INITIALIZED_ALL); -#ifdef CONFIG_ENCODING +#if HAVE_ENCODING encode_lavc_finish(mpctx->encode_lavc_ctx); encode_lavc_free(mpctx->encode_lavc_ctx); #endif mpctx->encode_lavc_ctx = NULL; -#ifdef CONFIG_LUA +#if HAVE_LUA |