From 3659f9e41646b95dc812640a49bb0b8cb879e441 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 2 Sep 2016 09:42:19 +0200 Subject: command: deprecate "cache" property, replace with "cache-percent" The --cache option and cache property conflict, so one of them has to be renamed. The option is probably used frequently, so initiate deprecation/rename of the property. --- DOCS/interface-changes.rst | 1 + DOCS/man/input.rst | 6 +----- player/command.c | 6 ++++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index f2b8b19514..6d33c4afad 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -33,6 +33,7 @@ Interface changes - "demuxer" -> "current-demuxer" - "fps" -> "container-fps" - "idle" -> "idle-active" + - "cache" -> "cache-percent" the old names are deprecated - remove deprecated "hwdec-active" and "hwdec-detected" properties - remove "pre-shaders", "post-shaders" and "scale-shader": deprecated diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 56fa6b355e..dbd6166df9 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2089,11 +2089,7 @@ caveats with some properties (due to historical reasons): If a VO is created, this will return either the actual display FPS, or an invalid value, instead of the option value. -``cache`` - This behaves completely different as property: instead of configuring the - cache size like the option, it returns the cache state in percent. - -``demuxer``, ``idle``, ``length``, ``audio-samplerate``, ``audio-channels``, ``audio-format``, ``fps`` +``demuxer``, ``idle``, ``length``, ``audio-samplerate``, ``audio-channels``, ``audio-format``, ``fps``, ``cache`` These behave completely different as property, but are deprecated (newer aliases which don't conflict have been added). After the deprecation period they will be changed to the proper option behavior. diff --git a/player/command.c b/player/command.c index 17e320cd06..379ce07edb 100644 --- a/player/command.c +++ b/player/command.c @@ -3717,7 +3717,8 @@ static const struct m_property mp_properties_base[] = { {"eof-reached", mp_property_eof_reached}, {"seeking", mp_property_seeking}, {"playback-abort", mp_property_playback_abort}, - {"cache", mp_property_cache}, // conflicts with option + {"cache-percent", mp_property_cache}, + M_PROPERTY_DEPRECATED_ALIAS("cache", "cache-percent"), // conflicts with option {"cache-free", mp_property_cache_free}, {"cache-used", mp_property_cache_used}, {"cache-size", mp_property_cache_size}, @@ -3944,7 +3945,8 @@ static const char *const *const mp_event_property_change[] = { E(MPV_EVENT_CHAPTER_CHANGE, "chapter", "chapter-metadata"), E(MP_EVENT_CACHE_UPDATE, "cache", "cache-free", "cache-used", "cache-idle", "demuxer-cache-duration", "demuxer-cache-idle", "paused-for-cache", - "demuxer-cache-time", "cache-buffering-state", "cache-speed"), + "demuxer-cache-time", "cache-buffering-state", "cache-speed", + "cache-percent"), E(MP_EVENT_WIN_RESIZE, "window-scale", "osd-width", "osd-height", "osd-par"), E(MP_EVENT_WIN_STATE, "window-minimized", "display-names", "display-fps", "fullscreen"), -- cgit v1.2.3