From 18cd32fbc4b5a7317d2ea737592ac1844cbe87fe Mon Sep 17 00:00:00 2001 From: Hitesh Kumar Saini Date: Tue, 14 Nov 2023 19:24:04 +0530 Subject: [PATCH] feat(mpv): mix with others --- patches/mpv-mix-with-others.patch | 13 +++++++++++++ scripts/mpv/build.sh | 1 + 2 files changed, 14 insertions(+) create mode 100644 patches/mpv-mix-with-others.patch diff --git a/patches/mpv-mix-with-others.patch b/patches/mpv-mix-with-others.patch new file mode 100644 index 0000000..250491c --- /dev/null +++ b/patches/mpv-mix-with-others.patch @@ -0,0 +1,13 @@ +diff --git a/audio/out/ao_audiounit.m b/audio/out/ao_audiounit.m +index 85b1226dc9..a4130357bc 100644 +--- a/audio/out/ao_audiounit.m ++++ b/audio/out/ao_audiounit.m +@@ -115,7 +115,7 @@ static bool init_audiounit(struct ao *ao) + + MP_VERBOSE(ao, "max channels: %ld, requested: %d\n", maxChannels, (int)ao->channels.num); + +- [instance setCategory:AVAudioSessionCategoryPlayback error:nil]; ++ [instance setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; + [instance setMode:AVAudioSessionModeMoviePlayback error:nil]; + [instance setActive:YES error:nil]; + [instance setPreferredOutputNumberOfChannels:prefChannels error:nil]; diff --git a/scripts/mpv/build.sh b/scripts/mpv/build.sh index ce9ba20..1d1ed1a 100644 --- a/scripts/mpv/build.sh +++ b/scripts/mpv/build.sh @@ -6,6 +6,7 @@ set -u # treat unset variables as an error cd ${SRC_DIR} patch -p1 <${PROJECT_DIR}/patches/mpv-fix-missing-objc.patch +patch -p1 <${PROJECT_DIR}/patches/mpv-mix-with-others.patch if [ "${VARIANT}" == "audio" ]; then patch -p1 <${PROJECT_DIR}/patches/mpv-remove-libass.patch fi