From b8ade7c99b830ee9870040bcfc1f2c3d3a64d172 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 16 Sep 2016 14:23:54 +0200 Subject: player, ao, vo: don't call mp_input_wakeup() directly Currently, calling mp_input_wakeup() will wake up the core thread (also called the playloop). This seems odd, but currently the core indeed calls mp_input_wait() when it has nothing more to do. It's done this way because MPlayer used input_ctx as central "mainloop". This is probably going to change. Remove direct calls to this function, and replace it with mp_wakeup_core() calls. ao and vo are changed to use opaque callbacks and not use input_ctx for this purpose. Other code already uses opaque callbacks, or has legitimate reasons to use input_ctx directly (such as sending actual user input). --- audio/out/ao.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'audio/out/ao.h') diff --git a/audio/out/ao.h b/audio/out/ao.h index fe09e2750a..4a4d433c2b 100644 --- a/audio/out/ao.h +++ b/audio/out/ao.h @@ -85,7 +85,7 @@ struct mp_audio; struct ao *ao_init_best(struct mpv_global *global, int init_flags, - struct input_ctx *input_ctx, + void (*wakeup_cb)(void *ctx), void *wakeup_ctx, struct encode_lavc_context *encode_lavc_ctx, int samplerate, int format, struct mp_chmap channels); void ao_uninit(struct ao *ao); @@ -108,7 +108,8 @@ void ao_hotplug_event(struct ao *ao); struct ao_hotplug; struct ao_hotplug *ao_hotplug_create(struct mpv_global *global, - struct input_ctx *input_ctx); + void (*wakeup_cb)(void *ctx), + void *wakeup_ctx); void ao_hotplug_destroy(struct ao_hotplug *hp); bool ao_hotplug_check_update(struct ao_hotplug *hp); const char *ao_hotplug_get_detected_device(struct ao_hotplug *hp); -- cgit v1.2.3