diff options
author | wm4 <wm4@nowhere> | 2015-05-22 20:08:04 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-22 20:08:04 +0200 |
commit | 1eaceb5fae4eae3cc767b9329fdeda21ae1338f3 (patch) | |
tree | a76fe4373db29a9af44aa4927f6e7ce245ea8d6c | |
parent | ff0b33ac9da3bd685066843dff0ff7c8bb5342c7 (diff) |
command: remove old property deprecation warning mechanism
We don't need two.
This mechanism was basically for MPlayer, and it has expired its
usefulness by now.
-rw-r--r-- | options/m_property.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/options/m_property.c b/options/m_property.c index 7b1505c964..9af3c91081 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -36,49 +36,6 @@ #include "common/msg.h" #include "common/common.h" -struct legacy_prop { - const char *old, *new; -}; -static const struct legacy_prop legacy_props[] = { - {"switch_video", "video"}, - {"switch_audio", "audio"}, - {"switch_program", "program"}, - {"framedropping", "framedrop"}, - {"osdlevel", "osd-level"}, - {0} -}; - -static bool translate_legacy_property(struct mp_log *log, const char *name, - char *buffer, size_t buffer_size) -{ - if (strlen(name) + 1 > buffer_size) - return false; - - const char *old_name = name; - - for (int n = 0; legacy_props[n].new; n++) { - if (strcmp(name, legacy_props[n].old) == 0) { - name = legacy_props[n].new; - break; - } - } - - snprintf(buffer, buffer_size, "%s", name); - - // Old names used "_" instead of "-" - for (int n = 0; buffer[n]; n++) { - if (buffer[n] == '_') - buffer[n] = '-'; - } - - if (log && strcmp(old_name, buffer) != 0) { - mp_warn(log, "Warning: property '%s' is deprecated, replaced with '%s'." - " Fix your input.conf!\n", old_name, buffer); - } - - return true; -} - static struct m_property *m_property_list_find(const struct m_property *list, const char *name) { @@ -117,15 +74,11 @@ static int do_action(const struct m_property *prop_list, const char *name, // (as a hack, log can be NULL on read-only paths) int m_property_do(struct mp_log *log, const struct m_property *prop_list, - const char *in_name, int action, void *arg, void *ctx) + const char *name, int action, void *arg, void *ctx) { union m_option_value val = {0}; int r; - char name[64]; - if (!translate_legacy_property(log, in_name, name, sizeof(name))) - return M_PROPERTY_UNKNOWN; - struct m_option opt = {0}; r = do_action(prop_list, name, M_PROPERTY_GET_TYPE, &opt, ctx); if (r <= 0) |