mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.67k stars 2.83k forks source link

mac: compatibility for older dev tools #14334

Closed Akemi closed 1 week ago

Akemi commented 3 weeks ago

https://developer.apple.com/documentation/foundation/nslocking/4059821-withlock available from macOS 10.10 but xcode 14+ required. xcode 14.0 introduced swift 5.7

logger is a macOS 11 feature. i hope the runtime check works like that. otherwise the initialisation of the logger has to move to init or a computed property.

Fixes #14310

github-actions[bot] commented 3 weeks ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1613713282.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1613718793.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1613743415.zip)
macOS * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1613721805.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1613715205.zip) * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1613712637.zip)
uiryuu commented 2 weeks ago

AVSampleBufferAudioRendererOutputConfigurationDidChangeNotification is a macOS 12+ feature, so this line must be behind a version check as well. https://github.com/mpv-player/mpv/blob/5158a3d779ed5b6bcd41b4a0573847abc08dcb66/audio/out/ao_avfoundation.m#L318

Akemi commented 2 weeks ago

@ruihe774 see comment above. how broken would avfoundation be without that notification on macOS <=12? is there a possible workaround for older versions or should we just put the whole ao behind a macOS 12 guard?

ruihe774 commented 2 weeks ago

@ruihe774 see comment above. how broken would avfoundation be without that notification on macOS <=12? is there a possible workaround for older versions or should we just put the whole ao behind a macOS 12 guard?

Sorry for my late reply. According to the doc:

The output configuration of the playback hardware might change during the playback session if other apps play content in different formats. In these cases, the media content format doesn’t match the hardware configuration which would produce suboptimal rendering of the enqueued media data. When the framework detects such mismatch it posts this notification, so an app can flush the renderer and re-enqueue the sample buffers from the current media playhead, which configures the hardware based on the format of newly enqueued sample buffers.

So it is completely OK ignoring this notification.

Akemi commented 2 weeks ago

i added build time and runtime checks for the two features that are used in avfoundation and need at least macOS 11.3 or 12.