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 @@
1add --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
2001 Enable exclusive output mode. In this mode, the system is usually locked2001 Enable exclusive output mode. In this mode, the system is usually locked
2002 out, and only mpv will be able to output audio.2002 out, and only mpv will be able to output audio.
2003 2003
2004 This only works for some audio outputs, such as ``wasapi``, ``coreaudio``2004 This only works for some audio outputs, such as ``wasapi``, ``coreaudio``,
2005 and ``pipewire``. Other audio outputs silently ignore this option.2005 ``pipewire`` and ``audiounit``. Other audio outputs silently ignore this option.
2006 They either have no concept of exclusive mode, or the mpv side of the2006 They either have no concept of exclusive mode, or the mpv side of the
2007 implementation is missing.2007 implementation is missing.
2008 2008
audio/out/ao_audiounit.m+6−1
@@ -115,7 +115,12 @@ static bool init_audiounit(struct ao *ao) · 114 unmodified lines
115 115
116 MP_VERBOSE(ao, "max channels: %ld, requested: %d\n", maxChannels, (int)ao->channels.num);116 MP_VERBOSE(ao, "max channels: %ld, requested: %d\n", maxChannels, (int)ao->channels.num);
117 117
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];
119 [instance setMode:AVAudioSessionModeMoviePlayback error:nil];124 [instance setMode:AVAudioSessionModeMoviePlayback error:nil];
120 [instance setActive:YES error:nil];125 [instance setActive:YES error:nil];
121 [instance setPreferredOutputNumberOfChannels:prefChannels error:nil];126 [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