From 5409274e6d8153f7e36850604648f89e2d573e0d Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 27 Sep 2023 13:48:40 -0500 Subject: command: only warn shared-script-properties once Evidently I was wrong and mpv only actually warns once on deprecation (playlist-pos nor display-fps did not and warned every time, but those were outliers apparently). Someone complained so just hack it into command_ctx for now. --- player/command.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/player/command.c b/player/command.c index c09a8aaf6a..60576765f4 100644 --- a/player/command.c +++ b/player/command.c @@ -110,6 +110,7 @@ struct command_ctx { mpv_node udata; double cached_window_scale; + bool shared_script_warning; }; static const struct m_option script_props_type = { @@ -3617,8 +3618,11 @@ static int mp_property_script_props(void *ctx, struct m_property *prop, { MPContext *mpctx = ctx; struct command_ctx *cmd = mpctx->command_ctx; - MP_WARN(mpctx, "The shared-script-properties property is deprecated and will " - "be removed in the future. Use the user-data property instead.\n"); + if (!cmd->shared_script_warning) { + MP_WARN(mpctx, "The shared-script-properties property is deprecated and will " + "be removed in the future. Use the user-data property instead.\n"); + cmd->shared_script_warning = true; + } switch (action) { case M_PROPERTY_GET_TYPE: *(struct m_option *)arg = script_props_type; -- cgit v1.2.3