mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-26 21:00:21 +00:00
ao_audiounit: add --audio-exclusiv support, make non-exclusive default
This commit is contained in:
committed by
der richter
parent
11dcd445d9
commit
748fc2b752
1
DOCS/interface-changes/audiounit-exclusive.txt
Normal file
1
DOCS/interface-changes/audiounit-exclusive.txt
Normal file
@@ -0,0 +1 @@
|
||||
add --audio-exclusive option support for ao=audiounit and make non-exclusive the new default
|
||||
@@ -2001,8 +2001,8 @@ Audio
|
||||
Enable exclusive output mode. In this mode, the system is usually locked
|
||||
out, and only mpv will be able to output audio.
|
||||
|
||||
This only works for some audio outputs, such as ``wasapi``, ``coreaudio``
|
||||
and ``pipewire``. Other audio outputs silently ignore this option.
|
||||
This only works for some audio outputs, such as ``wasapi``, ``coreaudio``,
|
||||
``pipewire`` and ``audiounit``. Other audio outputs silently ignore this option.
|
||||
They either have no concept of exclusive mode, or the mpv side of the
|
||||
implementation is missing.
|
||||
|
||||
|
||||
@@ -115,7 +115,12 @@ 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];
|
||||
AVAudioSessionCategoryOptions options = 0;
|
||||
if (!(ao->init_flags & AO_INIT_EXCLUSIVE)) {
|
||||
options |= AVAudioSessionCategoryOptionMixWithOthers;
|
||||
}
|
||||
|
||||
[instance setCategory:AVAudioSessionCategoryPlayback withOptions:options error:nil];
|
||||
[instance setMode:AVAudioSessionModeMoviePlayback error:nil];
|
||||
[instance setActive:YES error:nil];
|
||||
[instance setPreferredOutputNumberOfChannels:prefChannels error:nil];
|
||||
|
||||
Reference in New Issue
Block a user