build time and runtime checks.
Unified · Split
| @@ -254,9 +254,11 @@ static int init(struct ao *ao) · 253 unmodified lines | ||
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | [p->synchronizer addRenderer:p->renderer]; |
| 257 | +#if HAVE_MACOS_11_3_FEATURES | |
| 257 | 258 | if (@available(tvOS 14.5, iOS 14.5, macOS 11.3, *)) { |
| 258 | 259 | [p->synchronizer setDelaysRateChangeUntilHasSufficientMediaData:NO]; |
| 259 | 260 | } |
| 261 | +#endif | |
| 260 | 262 | |
| 261 | 263 | if (af_fmt_is_spdif(ao->format)) { |
| 262 | 264 | MP_FATAL(ao, "avfoundation does not support SPDIF\n"); |
| @@ -315,7 +317,11 @@ static int init(struct ao *ao) · 52 unmodified lines | ||
| 315 | 317 | |
| 316 | 318 | p->observer = [[AVObserver alloc] initWithAO:ao]; |
| 317 | 319 | NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; |
| 318 | − [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererOutputConfigurationDidChangeNotification object:p->renderer]; | |
| 320 | +#if HAVE_MACOS_12_FEATURES | |
| 321 | + if (@available(tvOS 15.0, iOS 15.0, macOS 12.0, *)) { | |
| 322 | + [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererOutputConfigurationDidChangeNotification object:p->renderer]; | |
| 323 | + } | |
| 324 | +#endif | |
| 319 | 325 | [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererWasFlushedAutomaticallyNotification object:p->renderer]; |
| 320 | 326 | |
| 321 | 327 | return CONTROL_OK; |
| @@ -1587,6 +1587,12 @@ macos_11_features = get_option('macos-11-features').require( · 1586 unmodified lines | ||
| 1587 | 1587 | ) |
| 1588 | 1588 | features += {'macos-11-features': macos_11_features.allowed()} |
| 1589 | 1589 | |
| 1590 | +macos_11_3_features = get_option('macos-11-3-features').require( | |
| 1591 | + macos_sdk_version.version_compare('>= 11.3'), | |
| 1592 | + error_message: 'A macos sdk version >= 11.3 could not be found!', | |
| 1593 | +) | |
| 1594 | +features += {'macos-11-3-features': macos_11_3_features.allowed()} | |
| 1595 | + | |
| 1590 | 1596 | macos_12_features = get_option('macos-12-features').require( |
| 1591 | 1597 | macos_sdk_version.version_compare('>= 12'), |
| 1592 | 1598 | error_message: 'A macos sdk version >= 12 could not be found!', |
| @@ -108,6 +108,7 @@ option('vulkan-interop', type: 'feature', value: 'auto', description: 'Vulkan gr · 107 unmodified lines | ||
| 108 | 108 | # macOS features |
| 109 | 109 | option('macos-10-15-4-features', type: 'feature', value: 'auto', description: 'macOS 10.15.4 SDK Features') |
| 110 | 110 | option('macos-11-features', type: 'feature', value: 'auto', description: 'macOS 11 SDK Features') |
| 111 | +option('macos-11-3-features', type: 'feature', value: 'auto', description: 'macOS 11.3 SDK Features') | |
| 111 | 112 | option('macos-12-features', type: 'feature', value: 'auto', description: 'macOS 12 SDK Features') |
| 112 | 113 | option('macos-cocoa-cb', type: 'feature', value: 'auto', description: 'macOS libmpv backend') |
| 113 | 114 | option('macos-media-player', type: 'feature', value: 'auto', description: 'macOS Media Player support') |