From 26d69758f67b631a266474a51123cf58be48af35 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Aug 2014 23:53:11 +0200 Subject: command: run OSD display code even if a property is unavailable Trying to jump chapters in a gile that has no chapters does nothing, not even show a warning. This is confusing. The reason is that the "add chapter" command will just bail out completely if the property is unavailable. This was because it exited when it couldn't get the property type. Instead of exiting, just don't enter the code that needs the type. (I'm not sure when this behavior changed. I consider it a regression. It was probably caused by changes to the chapter code, which perhaps started returning UNAVAILABLE instead of OK if there are no chapters.) --- player/command.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index 9c73f076b9..270798d925 100644 --- a/player/command.c +++ b/player/command.c @@ -3023,13 +3023,9 @@ static const struct property_osd_display { static void show_property_osd(MPContext *mpctx, const char *pname, int osd_mode) { struct MPOpts *opts = mpctx->opts; - struct m_option prop = {0}; const struct property_osd_display *p; const char *name = pname; - if (mp_property_do(pname, M_PROPERTY_GET_TYPE, &prop, mpctx) <= 0) - return; - int osd_progbar = 0; const char *osd_name = NULL; const char *msg = NULL; @@ -3074,6 +3070,8 @@ static void show_property_osd(MPContext *mpctx, const char *pname, int osd_mode) if (!msg && osd_name) msg = talloc_asprintf(tmp, "%s: ${%s}", osd_name, name); + struct m_option prop = {0}; + mp_property_do(pname, M_PROPERTY_GET_TYPE, &prop, mpctx); if (osd_progbar && (prop.flags & CONF_RANGE) == CONF_RANGE) { bool ok = false; if (prop.type == CONF_TYPE_INT) { -- cgit v1.2.3