mirror of
https://github.com/mpv-player/mpv
synced 2025-02-01 04:31:39 +00:00
command: simplify mp_property_filter_metadata
Also silence a dead code coverity error.
This commit is contained in:
parent
d969a0a27d
commit
a2cf846a5c
@ -1428,7 +1428,6 @@ static int mp_property_filter_metadata(void *ctx, struct m_property *prop,
|
|||||||
char *rem;
|
char *rem;
|
||||||
m_property_split_path(ka->key, &key, &rem);
|
m_property_split_path(ka->key, &key, &rem);
|
||||||
struct mp_tags *metadata = NULL;
|
struct mp_tags *metadata = NULL;
|
||||||
int res = CONTROL_UNKNOWN;
|
|
||||||
struct mp_output_chain *chain = NULL;
|
struct mp_output_chain *chain = NULL;
|
||||||
if (strcmp(type, "vf") == 0) {
|
if (strcmp(type, "vf") == 0) {
|
||||||
chain = mpctx->vo_chain ? mpctx->vo_chain->filter : NULL;
|
chain = mpctx->vo_chain ? mpctx->vo_chain->filter : NULL;
|
||||||
@ -1444,26 +1443,19 @@ static int mp_property_filter_metadata(void *ctx, struct m_property *prop,
|
|||||||
};
|
};
|
||||||
mp_output_chain_command(chain, mp_tprintf(80, "%.*s", BSTR_P(key)), &cmd);
|
mp_output_chain_command(chain, mp_tprintf(80, "%.*s", BSTR_P(key)), &cmd);
|
||||||
|
|
||||||
if (metadata)
|
if (!metadata)
|
||||||
res = CONTROL_OK;
|
|
||||||
|
|
||||||
switch (res) {
|
|
||||||
case CONTROL_UNKNOWN:
|
|
||||||
return M_PROPERTY_UNKNOWN;
|
|
||||||
case CONTROL_NA: // empty
|
|
||||||
case CONTROL_OK:
|
|
||||||
if (strlen(rem)) {
|
|
||||||
struct m_property_action_arg next_ka = *ka;
|
|
||||||
next_ka.key = rem;
|
|
||||||
res = tag_property(M_PROPERTY_KEY_ACTION, &next_ka, metadata);
|
|
||||||
} else {
|
|
||||||
res = tag_property(ka->action, ka->arg, metadata);
|
|
||||||
}
|
|
||||||
talloc_free(metadata);
|
|
||||||
return res;
|
|
||||||
default:
|
|
||||||
return M_PROPERTY_ERROR;
|
return M_PROPERTY_ERROR;
|
||||||
|
|
||||||
|
int res;
|
||||||
|
if (strlen(rem)) {
|
||||||
|
struct m_property_action_arg next_ka = *ka;
|
||||||
|
next_ka.key = rem;
|
||||||
|
res = tag_property(M_PROPERTY_KEY_ACTION, &next_ka, metadata);
|
||||||
|
} else {
|
||||||
|
res = tag_property(ka->action, ka->arg, metadata);
|
||||||
}
|
}
|
||||||
|
talloc_free(metadata);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
return M_PROPERTY_NOT_IMPLEMENTED;
|
return M_PROPERTY_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user