Skip to content

Commit

Permalink
ios/macos: use non-exclusive audio session
Browse files Browse the repository at this point in the history
Using this option means the OS  won't pause other
sources of audio when playback starts in MPV.

This matches the behaviour on other platforms.
  • Loading branch information
moffatman committed Dec 13, 2024
1 parent 7768c3d commit 4685eb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion audio/out/ao_audiounit.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ 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];
Expand Down

0 comments on commit 4685eb7

Please sign in to comment.