From 60ca2d8f4d93f7a8535a00cf36f1fd57a06d0088 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 21 Sep 2014 16:00:03 +0200 Subject: command: remove unneeded ifdefs Why bother? Also, since now some properties could be mapped to non-existing options, but mp_property_generic_option() is used, deal with this case and return a not-found error code. --- player/command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index d6ac3adc25..0c0b28d5f4 100644 --- a/player/command.c +++ b/player/command.c @@ -140,6 +140,10 @@ static int mp_property_generic_option(void *ctx, struct m_property *prop, const char *optname = prop->name; struct m_config_option *opt = m_config_get_co(mpctx->mconfig, bstr0(optname)); + + if (!opt) + return M_PROPERTY_UNKNOWN; + void *valptr = opt->data; switch (action) { @@ -2837,11 +2841,9 @@ static const struct m_property mp_properties[] = { {"sub-visibility", property_osd_helper}, {"sub-forced-only", property_osd_helper}, {"sub-scale", property_osd_helper}, -#if HAVE_LIBASS {"ass-use-margins", property_osd_helper}, {"ass-vsfilter-aspect-compat", property_osd_helper}, {"ass-style-override", property_osd_helper}, -#endif {"vf", mp_property_vf}, {"af", mp_property_af}, @@ -3062,12 +3064,10 @@ static const 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}"}, -#if HAVE_TV { "tv-brightness", "Brightness", .osd_progbar = OSD_BRIGHTNESS }, { "tv-hue", "Hue", .osd_progbar = OSD_HUE}, { "tv-saturation", "Saturation", .osd_progbar = OSD_SATURATION }, { "tv-contrast", "Contrast", .osd_progbar = OSD_CONTRAST }, -#endif {0} }; -- cgit v1.2.3