History

ao_avfoundation: guard features only available on macOS 11.3 and 12

build time and runtime checks.

der richter committed 2 years ago

Commit bc5ab971 parent 55241da3 files · +14 −1Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t