From b6af3db5680586c209bae53a7eb779ad0d38edc8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 9 Oct 2017 15:48:47 +0200 Subject: [PATCH] command: drop "audio-out-detected-device" property Coreaudio stopped setting it a few releases ago (66a958bb4fa). There is not much of a user- or API-visible change, so remove it without deprecation. --- DOCS/interface-changes.rst | 2 ++ DOCS/man/input.rst | 4 ---- TOOLS/lua/audio-hotplug-test.lua | 5 ----- audio/out/ao.c | 7 ------- audio/out/ao.h | 1 - audio/out/internal.h | 3 --- player/command.c | 16 +--------------- 7 files changed, 3 insertions(+), 35 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 29291d5151..f81132542b 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -39,6 +39,8 @@ Interface changes - remove the (deprecated) --vo=opengl-hq - remove --opengl-es=force2 (use --opengl-es=yes --opengl-restrict=300) - the --msg-level option now affects --log-file + - drop "audio-out-detected-device" property - this was unavailable on all + audio output drivers for quite a while (coreaudio used to provide it) --- mpv 0.27.0 --- - drop previously deprecated --field-dominance option - drop previously deprecated "osd" command diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 1bc033ea00..5b642660d4 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2017,10 +2017,6 @@ Property list ``current-ao`` Current audio output driver (name as used with ``--ao``). -``audio-out-detected-device`` - Return the audio device selected by the AO driver (only implemented for - some drivers: currently only ``coreaudio``). - ``working-directory`` Return the working directory of the mpv process. Can be useful for JSON IPC users, because the command line player usually works with relative paths. diff --git a/TOOLS/lua/audio-hotplug-test.lua b/TOOLS/lua/audio-hotplug-test.lua index f27b793151..8dedc68cbe 100644 --- a/TOOLS/lua/audio-hotplug-test.lua +++ b/TOOLS/lua/audio-hotplug-test.lua @@ -6,8 +6,3 @@ mp.observe_property("audio-device-list", "native", function(name, val) print(" - '" .. e.name .. "' (" .. e.description .. ")") end end) - -mp.observe_property("audio-out-detected-device", "native", function(name, val) - print("Detected audio device changed:") - print(" - '" .. val) -end) diff --git a/audio/out/ao.c b/audio/out/ao.c index c38c04c6a9..da2dacdcae 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -550,13 +550,6 @@ bool ao_hotplug_check_update(struct ao_hotplug *hp) return false; } -const char *ao_hotplug_get_detected_device(struct ao_hotplug *hp) -{ - if (!hp || !hp->ao) - return NULL; - return hp->ao->detected_device; -} - // The return value is valid until the next call to this API. struct ao_device_list *ao_hotplug_get_device_list(struct ao_hotplug *hp) { diff --git a/audio/out/ao.h b/audio/out/ao.h index fbbd76fee8..116733fb39 100644 --- a/audio/out/ao.h +++ b/audio/out/ao.h @@ -112,7 +112,6 @@ struct ao_hotplug *ao_hotplug_create(struct mpv_global *global, 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); struct ao_device_list *ao_hotplug_get_device_list(struct ao_hotplug *hp); void ao_print_devices(struct mpv_global *global, struct mp_log *log); diff --git a/audio/out/internal.h b/audio/out/internal.h index 28deefe128..a6fcf7c5f6 100644 --- a/audio/out/internal.h +++ b/audio/out/internal.h @@ -61,9 +61,6 @@ struct ao { // default device should be used, this is set to NULL. char *device; - // Device actually chosen by the AO - char *detected_device; - // Application name to report to the audio API. char *client_name; diff --git a/player/command.c b/player/command.c index 1cf8dc2438..f3ab31aec5 100644 --- a/player/command.c +++ b/player/command.c @@ -1970,17 +1970,6 @@ static int mp_property_ao(void *ctx, struct m_property *p, int action, void *arg mpctx->ao ? ao_get_name(mpctx->ao) : NULL); } -static int mp_property_ao_detected_device(void *ctx,struct m_property *prop, - int action, void *arg) -{ - struct MPContext *mpctx = ctx; - struct command_ctx *cmd = mpctx->command_ctx; - create_hotplug(mpctx); - - const char *d = ao_hotplug_get_detected_device(cmd->hotplug); - return m_property_strdup_ro(action, arg, d); -} - /// Audio delay (RW) static int mp_property_audio_delay(void *ctx, struct m_property *prop, int action, void *arg) @@ -3983,7 +3972,6 @@ static const struct m_property mp_properties_base[] = { {"audio-device", mp_property_audio_device}, {"audio-device-list", mp_property_audio_devices}, {"current-ao", mp_property_ao}, - {"audio-out-detected-device", mp_property_ao_detected_device}, // Video {"fullscreen", mp_property_fullscreen}, @@ -5773,10 +5761,8 @@ void handle_command_updates(struct MPContext *mpctx) // This is a bit messy: ao_hotplug wakes up the player, and then we have // to recheck the state. Then the client(s) will read the property. - if (ctx->hotplug && ao_hotplug_check_update(ctx->hotplug)) { + if (ctx->hotplug && ao_hotplug_check_update(ctx->hotplug)) mp_notify_property(mpctx, "audio-device-list"); - mp_notify_property(mpctx, "audio-out-detected-device"); - } } void mp_notify(struct MPContext *mpctx, int event, void *arg)