summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-12-22 14:35:32 +0100
committerwm4 <wm4@nowhere>2019-12-22 14:37:28 +0100
commit0eabc6614a0d7c5d8d57a8a74d7b7447677038cd (patch)
treeb02d3e718ffe241b08a6900c01264cf473a51416
parentb670838b3d8970db1932b3f83fedb7edaa324c80 (diff)
downloadmpv-0eabc6614a0d7c5d8d57a8a74d7b7447677038cd.tar.bz2
mpv-0eabc6614a0d7c5d8d57a8a74d7b7447677038cd.tar.xz
client API: deprecate tick event
This is conceptually outdated and should not exist. This affects Lua scripting and JSON IPC too.
-rw-r--r--DOCS/client-api-changes.rst1
-rw-r--r--libmpv/client.h7
-rw-r--r--player/client.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/DOCS/client-api-changes.rst b/DOCS/client-api-changes.rst
index e52e04d54a..7a3fe9741d 100644
--- a/DOCS/client-api-changes.rst
+++ b/DOCS/client-api-changes.rst
@@ -33,6 +33,7 @@ API changes
::
--- mpv 0.30.0 ---
+ 1.107 - Deprecate MPV_EVENT_TICK
1.106 - Add cancel_fn to mpv_stream_cb_info
1.105 - Fix deadlock problems with MPV_RENDER_PARAM_ADVANCED_CONTROL and if
the "vd-lavc-dr" option is enabled (which it is by default).
diff --git a/libmpv/client.h b/libmpv/client.h
index 4319240888..2e8dcdc960 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -227,7 +227,7 @@ extern "C" {
* relational operators (<, >, <=, >=).
*/
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 106)
+#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 107)
/**
* The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before
@@ -1356,15 +1356,16 @@ typedef enum mpv_event_id {
* removed in the far future.
*/
MPV_EVENT_UNPAUSE = 13,
-#endif
/**
* Sent every time after a video frame is displayed. Note that currently,
* this will be sent in lower frequency if there is no video, or playback
* is paused - but that will be removed in the future, and it will be
* restricted to video frames only.
+ *
+ * @deprecated Use mpv_observe_property() with relevant properties instead
+ * (such as "playback-time").
*/
MPV_EVENT_TICK = 14,
-#if MPV_ENABLE_DEPRECATED
/**
* @deprecated This was used internally with the internal "script_dispatch"
* command to dispatch keyboard and mouse input for the OSC.
diff --git a/player/client.c b/player/client.c
index 0d1a4e6d53..e44f3cacea 100644
--- a/player/client.c
+++ b/player/client.c
@@ -840,6 +840,8 @@ int mpv_request_event(mpv_handle *ctx, mpv_event_id event, int enable)
pthread_mutex_lock(&ctx->lock);
uint64_t bit = 1ULL << event;
ctx->event_mask = enable ? ctx->event_mask | bit : ctx->event_mask & ~bit;
+ if (enable && event == MPV_EVENT_TICK)
+ MP_WARN(ctx, "The 'tick' event is deprecated and will be removed.\n");
pthread_mutex_unlock(&ctx->lock);
return 0;
}