summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-27 13:48:40 -0500
committerDudemanguy <random342@airmail.cc>2023-09-27 13:48:40 -0500
commit5409274e6d8153f7e36850604648f89e2d573e0d (patch)
treefe4a6bff8676ab40294c4170e69d25bbeb9d9c84
parent1b4627f6470e94636932987844bafc939ec9281a (diff)
downloadmpv-5409274e6d8153f7e36850604648f89e2d573e0d.tar.bz2
mpv-5409274e6d8153f7e36850604648f89e2d573e0d.tar.xz
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.
-rw-r--r--player/command.c8
1 files 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;