mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
1b4627f647
commit
5409274e6d
|
@ -110,6 +110,7 @@ struct command_ctx {
|
||||||
mpv_node udata;
|
mpv_node udata;
|
||||||
|
|
||||||
double cached_window_scale;
|
double cached_window_scale;
|
||||||
|
bool shared_script_warning;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct m_option script_props_type = {
|
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;
|
MPContext *mpctx = ctx;
|
||||||
struct command_ctx *cmd = mpctx->command_ctx;
|
struct command_ctx *cmd = mpctx->command_ctx;
|
||||||
MP_WARN(mpctx, "The shared-script-properties property is deprecated and will "
|
if (!cmd->shared_script_warning) {
|
||||||
"be removed in the future. Use the user-data property instead.\n");
|
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) {
|
switch (action) {
|
||||||
case M_PROPERTY_GET_TYPE:
|
case M_PROPERTY_GET_TYPE:
|
||||||
*(struct m_option *)arg = script_props_type;
|
*(struct m_option *)arg = script_props_type;
|
||||||
|
|
Loading…
Reference in New Issue