mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
Fall back to avfoundation AO when coreaudio fails on macOS
macOS 27 beta's AUHAL rejects mpv's channel-layout property with paramErr (-50), so the coreaudio AO fails to initialize and playback is silent. Change the macOS ao option from "coreaudio" to "coreaudio,avfoundation" so mpv self-heals: older macOS keeps using coreaudio unchanged, while the beta drops to avfoundation (AVSampleBufferAudioRenderer) instead of playing no sound.
This commit is contained in:
@@ -461,7 +461,13 @@ final class MPVClient: @unchecked Sendable {
|
|||||||
#elseif os(iOS)
|
#elseif os(iOS)
|
||||||
setOptionSync("ao", "audiounit")
|
setOptionSync("ao", "audiounit")
|
||||||
#elseif os(macOS)
|
#elseif os(macOS)
|
||||||
setOptionSync("ao", "coreaudio")
|
// coreaudio is the native macOS AO, but on macOS 27 beta it fails to
|
||||||
|
// initialize ("unable to set the input channel layout on the audio
|
||||||
|
// unit … -50"), leaving playback silent. Add avfoundation
|
||||||
|
// (AVSampleBufferAudioRenderer) as a fallback so mpv self-heals: older
|
||||||
|
// macOS keeps using coreaudio, and where coreaudio can't open the
|
||||||
|
// device mpv drops to avfoundation instead of playing no sound.
|
||||||
|
setOptionSync("ao", "coreaudio,avfoundation")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Cache settings for network streams
|
// Cache settings for network streams
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ private struct DefaultOptionsSection: View {
|
|||||||
#if os(iOS) || os(tvOS)
|
#if os(iOS) || os(tvOS)
|
||||||
options.append(("ao", "audiounit"))
|
options.append(("ao", "audiounit"))
|
||||||
#else
|
#else
|
||||||
options.append(("ao", "coreaudio"))
|
options.append(("ao", "coreaudio,avfoundation"))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
options.append(("cache", "yes"))
|
options.append(("cache", "yes"))
|
||||||
|
|||||||
Reference in New Issue
Block a user