diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 0eebe9b2cb..d3e77187e8 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -34,6 +34,7 @@ Interface changes - replace vf_format's `peak` suboption by `sig-peak`, which is relative to the reference white level instead of in cd/m^2 - renamed the TRCs `st2084` and `std-b67` to `pq` and `hlg` respectively + - the "osd" command is deprecated (use "cycle osd-level") --- mpv 0.25.0 --- - remove opengl-cb dxva2 dummy hwdec interop (see git "vo_opengl: remove dxva2 dummy hwdec backend") diff --git a/input/cmd_list.c b/input/cmd_list.c index c54c2cc6aa..bc82e687fd 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -98,7 +98,9 @@ const struct mp_cmd_def mp_cmds[] = { { MP_CMD_PLAYLIST_SHUFFLE, "playlist-shuffle", }, { MP_CMD_SUB_STEP, "sub-step", { ARG_INT }, .allow_auto_repeat = true }, { MP_CMD_SUB_SEEK, "sub-seek", { ARG_INT }, .allow_auto_repeat = true }, +#if HAVE_GPL { MP_CMD_OSD, "osd", { OARG_INT(-1) } }, +#endif { MP_CMD_PRINT_TEXT, "print-text", { ARG_STRING }, .allow_auto_repeat = true }, { MP_CMD_SHOW_TEXT, "show-text", { ARG_STRING, OARG_INT(-1), OARG_INT(0) }, .allow_auto_repeat = true}, diff --git a/player/command.c b/player/command.c index 3df1b3fcd1..7facb7972e 100644 --- a/player/command.c +++ b/player/command.c @@ -5125,8 +5125,13 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re break; } +#if HAVE_GPL + // Potentially GPL due to 8d190244d21a4d40bb9e8f7d51aa09ca1888de09. case MP_CMD_OSD: { + MP_WARN(mpctx, "The 'osd' command is deprecated. " + "Use 'cycle osd-level' instead.\n"); int v = cmd->args[0].v.i; +#define MAX_OSD_LEVEL 3 if (opts->osd_level > MAX_OSD_LEVEL) opts->osd_level = MAX_OSD_LEVEL; if (v < 0) @@ -5140,6 +5145,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re mp_wakeup_core(mpctx); break; } +#endif case MP_CMD_PRINT_TEXT: { MP_INFO(mpctx, "%s\n", cmd->args[0].v.s); diff --git a/player/core.h b/player/core.h index 7945080538..ca7210f373 100644 --- a/player/core.h +++ b/player/core.h @@ -58,7 +58,6 @@ enum mp_osd_seek_info { enum { // other constants - MAX_OSD_LEVEL = 3, OSD_LEVEL_INVISIBLE = 4, OSD_BAR_SEEK = 256, diff --git a/player/osd.c b/player/osd.c index 75f4cdcf7b..67f2d05298 100644 --- a/player/osd.c +++ b/player/osd.c @@ -441,6 +441,8 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, int level) talloc_free(text); } else { sadd_hhmmssff_u(buffer, get_playback_time(mpctx), fractions); +#if HAVE_GPL + // Potentially GPL due to 8d190244d21a4d40bb9e8f7d51aa09ca1888de09. if (level == 3) { double len = get_time_length(mpctx); if (len >= 0) { @@ -449,6 +451,7 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, int level) } sadd_percentage(buffer, get_percent_pos(mpctx)); } +#endif } } }