-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
ao: don't call driver->set_paused after reset #14096
Conversation
This commit adds a state `hw_paused` for pull-based AO. `driver->set_paused(false)` is only called if `hw_paused` is true. `hw_paused` is cleared after `ao_reset`, so `set_paused` will not be called after a reset; instead, `driver->start()` will be called, which properly starts the AO.
Download the artifacts for this pull request: |
@low-batt Could you confirm the fix? |
@kasper93 BTW, I wonder if we can instead use a recursive mutex to avoid the split code path for pull-based and push-based AO. |
Confirmed fixed. I patched |
I prefer to not introduce new recursive mutex usage. I removed most recursive mutex in mpv code not long ago in #13818. Not requiring recursive mutex means mpv can use SRW lock on Windows, which has lower overhead for updating lock state. This could also be true for other platforms. |
You have reminded me. PThreads mutex on macOS, IIRC, has strong fairness and bad performance. It immediately parks the thread on contention. Maybe we can instead use an unfair and high-performance alternative on macOS. @Akemi What do you think of it? FYI: https://hacks.mozilla.org/2022/10/improving-firefox-responsiveness-on-macos/ |
in general, if there is a (performance) problem because of a platform independent library/code path/etc that could possibly be fixed with a platform dependent implementation, it might be worth investigating and using it. does the ff blog post suggest using private APIs and flags? then no, we have a policy to not use any private APIs.
|
I'm afraid so. ff uses a userspace workaround as fallback (https://bugzilla.mozilla.org/show_bug.cgi?id=1784018) |
For the record, this is the up to date link to the It is in the |
Thanks to everyone for fixing this one. IINA users are very excited about the support for spatial audio that the avfoundation audio driver provides. Your work is appreciated. |
This commit adds a state
hw_paused
for pull-based AO.driver->set_paused(false)
is only called ifhw_paused
is true.hw_paused
is cleared afterao_reset
, soset_paused
will not be called after a reset; instead,driver->start()
will be called, which properly starts the AO.Fixes #14092.