-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Muting is delayed with ao_avfoundation #15014
Comments
@ruihe774 mentioning you, in the case you didn't see this issue. |
No easy fix I'm afraid. Surely we can clear ao buffer on softvol mute: diff --git a/player/audio.c b/player/audio.c
index e86547c30e..229458da4d 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -186,6 +186,11 @@ void audio_update_volume(struct MPContext *mpctx)
gain = 0.0;
ao_set_gain(ao_c->ao, gain);
+
+ if (opts->softvol_mute) {
+ ao_reset(ao_c->ao);
+ ao_start(ao_c->ao);
+ }
}
// Call this if opts->playback_speed or mpctx->speed_factor_* change. But this it bound to cause some AV desync. FWIW this is not a problem specific to ao_avfoundation; all pull-based AOs have this issue if they are used with large device buffers. For now, a simple workaround is not to use softvol mute but to use ao mute instead; ao_avfoundation works well with ao volume and ao mute with no issues that were encountered in other AOs; I don't think there are reasons not to use them. Simply put this config into your
Some AOs (e.g. pipewire) remember ao volume and ao mute even after mpv quits. If you want to prevent this behavior, you can use the following lua script. This does not apply to ao_avfoundation as it does not remember. mp.register_event("audio-reconfig", function()
mp.set_property_number("ao-volume", 100)
mp.set_property_bool("ao-mute", false)
end) |
@MarioMastr @low-batt I've added a new option |
mpv Information
Other Information
Reproduction Steps
Play any video with --no-config --ao=avfoundation and toggle mute (either by using the keybind or using the menu bar).
Expected Behavior
Same behaviour as ao_coreaudio, which mutes as soon as toggled.
Actual Behavior
It takes at least a second to actually mute the audio.
Log File
output.txt
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
--log-file=output.txt
.The text was updated successfully, but these errors were encountered: