summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-21 12:19:59 +0200
committerwm4 <wm4@nowhere>2012-10-12 10:10:31 +0200
commited8e738e0f7da90597732965fe4e8cd1feb9099a (patch)
tree0665723e3a5db809b188d4e34f275ec0d9fc3df5 /command.c
parentd6dad9e93431f8ec3ad7999d0bac3a585b47866c (diff)
downloadmpv-ed8e738e0f7da90597732965fe4e8cd1feb9099a.tar.bz2
mpv-ed8e738e0f7da90597732965fe4e8cd1feb9099a.tar.xz
commands: cosmetic changes mostly to m_property.h
The Doxygen-style documentation comments were nothing but bloat. Also move mp_property_do() and mp_property_print() to command.h, where they should belong, and fix their argument types. m_property.c/h is supposed to be generic, while command.h provides declarations specific to the mplayer core.
Diffstat (limited to 'command.c')
-rw-r--r--command.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/command.c b/command.c
index 6db4310f46..1b61846205 100644
--- a/command.c
+++ b/command.c
@@ -491,8 +491,6 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
if (!demuxer)
return M_PROPERTY_UNAVAILABLE;
- m_property_action_t *ka;
- char *meta;
static const m_option_t key_type =
{
"metadata", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL
@@ -505,9 +503,10 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
*(char ***)arg = slist;
return M_PROPERTY_OK;
}
- case M_PROPERTY_KEY_ACTION:
- ka = arg;
- if (!(meta = demux_info_get(demuxer, ka->key)))
+ case M_PROPERTY_KEY_ACTION: {
+ struct m_property_action *ka = arg;
+ char *meta = demux_info_get(demuxer, ka->key);
+ if (!meta)
return M_PROPERTY_UNKNOWN;
switch (ka->action) {
case M_PROPERTY_GET:
@@ -518,6 +517,7 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
return M_PROPERTY_OK;
}
}
+ }
return M_PROPERTY_NOT_IMPLEMENTED;
}
@@ -1495,12 +1495,13 @@ static char *translate_legacy_property(void *talloc_ctx, const char *name)
return new_name ? new_name : (char *)name;
}
-int mp_property_do(const char *name, int action, void *val, void *ctx)
+int mp_property_do(const char *name, int action, void *val,
+ struct MPContext *ctx)
{
return m_property_do(mp_properties, name, action, val, ctx);
}
-char *mp_property_print(const char *name, void *ctx)
+char *mp_property_print(const char *name, struct MPContext *ctx)
{
char *ret = NULL;
if (mp_property_do(name, M_PROPERTY_PRINT, &ret, ctx) <= 0)
@@ -1646,8 +1647,6 @@ static const char *property_error_string(int error_value)
return "NOT_IMPLEMENTED";
case M_PROPERTY_UNKNOWN:
return "PROPERTY_UNKNOWN";
- case M_PROPERTY_DISABLED:
- return "DISABLED";
}
return "UNKNOWN";
}