History

ao_audiounit: add --audio-exclusiv support, make non-exclusive default

Callum Moffat committed 1 year ago

Commit 748fc2b1 parent 11dcd443 files · +9 −3Browse files

Unified · Split

3 files
  1. DOCS/interface-changes/audiounit-exclusive.txt +1 −0
  2. DOCS/man/options.rst +2 −2
  3. audio/out/ao_audiounit.m +6 −1
DOCS/interface-changes/audiounit-exclusive.txt+1−0
@@ -0,0 +1 @@
1+add --audio-exclusive option support for ao=audiounit and make non-exclusive the new default
DOCS/man/options.rst+2−2
@@ -2001,8 +2001,8 @@ Audio · 2000 unmodified lines
20012001 Enable exclusive output mode. In this mode, the system is usually locked
20022002 out, and only mpv will be able to output audio.
20032003
2004− This only works for some audio outputs, such as ``wasapi``, ``coreaudio``
2005− and ``pipewire``. Other audio outputs silently ignore this option.
2004+ This only works for some audio outputs, such as ``wasapi``, ``coreaudio``,
2005+ ``pipewire`` and ``audiounit``. Other audio outputs silently ignore this option.
20062006 They either have no concept of exclusive mode, or the mpv side of the
20072007 implementation is missing.
20082008
audio/out/ao_audiounit.m+6−1
@@ -115,7 +115,12 @@ static bool init_audiounit(struct ao *ao) · 114 unmodified lines
115115
116116 MP_VERBOSE(ao, "max channels: %ld, requested: %d\n", maxChannels, (int)ao->channels.num);
117117
118− [instance setCategory:AVAudioSessionCategoryPlayback error:nil];
118+ AVAudioSessionCategoryOptions options = 0;
119+ if (!(ao->init_flags & AO_INIT_EXCLUSIVE)) {
120+ options |= AVAudioSessionCategoryOptionMixWithOthers;
121+ }
122+
123+ [instance setCategory:AVAudioSessionCategoryPlayback withOptions:options error:nil];
119124 [instance setMode:AVAudioSessionModeMoviePlayback error:nil];
120125 [instance setActive:YES error:nil];
121126 [instance setPreferredOutputNumberOfChannels:prefChannels error:nil];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t