From 2bd1e78701483ceeb9864680aac76f8ce465fa9c Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Thu, 1 Aug 2024 17:35:59 -0500 Subject: [PATCH] build: ensure HAVE_WIN32_SMTC is always defined It makes sense to only descend into the subdirectory meson build file on windows, but we should always make sure HAVE_WIN32_SMTC is 0 for other platforms. Otherwise, it gets unneccesarily awkward to work with. --- meson.build | 3 +++ player/main.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b7bcb1b0ba..8cb2cc0855 100644 --- a/meson.build +++ b/meson.build @@ -530,8 +530,11 @@ if not posix and not features['win32-desktop'] 'osdep/terminal-dummy.c') endif +# media controls if win32 subdir('osdep/win32') +else + features += {'win32-smtc': false} endif features += {'glob-posix': cc.has_function('glob', prefix: '#include ')} diff --git a/player/main.c b/player/main.c index c6a78dfe31..7691a33669 100644 --- a/player/main.c +++ b/player/main.c @@ -399,7 +399,7 @@ int mp_initialize(struct MPContext *mpctx, char **options) cocoa_set_mpv_handle(ctx); #endif -#if defined(HAVE_WIN32_SMTC) && HAVE_WIN32_SMTC +#if HAVE_WIN32_SMTC if (opts->media_controls == 2 || (mpctx->is_cli && opts->media_controls == 1)) mp_smtc_init(mp_new_client(mpctx->clients, "SystemMediaTransportControls")); #endif