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
254254 }
255255
256256 [p->synchronizer addRenderer:p->renderer];
257+#if HAVE_MACOS_11_3_FEATURES
257258 if (@available(tvOS 14.5, iOS 14.5, macOS 11.3, *)) {
258259 [p->synchronizer setDelaysRateChangeUntilHasSufficientMediaData:NO];
259260 }
261+#endif
260262
261263 if (af_fmt_is_spdif(ao->format)) {
262264 MP_FATAL(ao, "avfoundation does not support SPDIF\n");
@@ -315,7 +317,11 @@ static int init(struct ao *ao) · 52 unmodified lines
315317
316318 p->observer = [[AVObserver alloc] initWithAO:ao];
317319 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
319325 [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererWasFlushedAutomaticallyNotification object:p->renderer];
320326
321327 return CONTROL_OK;
meson.build+6−0
@@ -1587,6 +1587,12 @@ macos_11_features = get_option('macos-11-features').require( · 1586 unmodified lines
15871587 )
15881588 features += {'macos-11-features': macos_11_features.allowed()}
15891589
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+
15901596 macos_12_features = get_option('macos-12-features').require(
15911597 macos_sdk_version.version_compare('>= 12'),
15921598 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
108108 # macOS features
109109 option('macos-10-15-4-features', type: 'feature', value: 'auto', description: 'macOS 10.15.4 SDK Features')
110110 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')
111112 option('macos-12-features', type: 'feature', value: 'auto', description: 'macOS 12 SDK Features')
112113 option('macos-cocoa-cb', type: 'feature', value: 'auto', description: 'macOS libmpv backend')
113114 option('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