[vlc-commits] [Git][videolan/vlc][master] 2 commits: AVAudioSession: remove unnecessary VISIONOS_AVAILABLE availability

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Dec 16 02:57:40 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4680b3db by Steve Lhomme at 2025-12-16T02:31:17+00:00
AVAudioSession: remove unnecessary VISIONOS_AVAILABLE availability

The API used are always available on Vision OS. "*" is considered true
in @available [^1].
This kind of define might be useful when we use API's only found in newer visionOS versions.

[^1]: https://clang.llvm.org/docs/LanguageExtensions.html#objective-c-available

- - - - -
9106f00f by Steve Lhomme at 2025-12-16T02:31:17+00:00
AVSampleBuffer aout: remove unnecessary VISIONOS_AVAILABLE availability

The API used are always available on Vision OS. "*" is considered true
in @available [^1].
This kind of define might be useful when we use API's only found in newer visionOS versions.

[^1]: https://clang.llvm.org/docs/LanguageExtensions.html#objective-c-available

- - - - -


2 changed files:

- modules/audio_output/apple/avaudiosession_common.m
- modules/audio_output/apple/avsamplebuffer.m


Changes:

=====================================
modules/audio_output/apple/avaudiosession_common.m
=====================================
@@ -33,10 +33,8 @@
 #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
 #define MIN_VISIONOS 1.0
 #define VISIONOS_API_AVAILABLE , visionos(MIN_VISIONOS)
-#define VISIONOS_AVAILABLE , visionOS MIN_VISIONOS
 #else
 #define VISIONOS_API_AVAILABLE
-#define VISIONOS_AVAILABLE
 #endif
 
 void
@@ -76,7 +74,7 @@ avas_PrepareFormat(audio_output_t *p_aout, AVAudioSession *instance,
 
     if (spatial_audio)
     {
-        if (@available(iOS 15.0, watchOS 8.0, tvOS 15.0 VISIONOS_AVAILABLE, *))
+        if (@available(iOS 15.0, watchOS 8.0, tvOS 15.0, *))
         {
             /* Not mandatory, SpatialAudio can work without it. It just signals to
              * the user that he is playing spatial content */
@@ -161,7 +159,7 @@ GetRouteSharingPolicy(audio_output_t *p_aout)
     AVAudioSessionRouteSharingPolicy policy = AVAudioSessionRouteSharingPolicyLongFormAudio;
     AVAudioSessionRouteSharingPolicy video_policy;
 #if TARGET_OS_IOS || TARGET_OS_VISION
-    if (@available(iOS 13.0 VISIONOS_AVAILABLE, *))
+    if (@available(iOS 13.0, *))
         video_policy = AVAudioSessionRouteSharingPolicyLongFormVideo;
     else
 #endif
@@ -205,7 +203,7 @@ avas_SetActive(audio_output_t *p_aout, AVAudioSession *instance, bool active,
 
     if (active)
     {
-        if (@available(iOS 11.0, watchOS 7.0, tvOS 11.0 VISIONOS_AVAILABLE, *))
+        if (@available(iOS 11.0, watchOS 7.0, tvOS 11.0, *))
         {
             AVAudioSessionRouteSharingPolicy policy = GetRouteSharingPolicy(p_aout);
 


=====================================
modules/audio_output/apple/avsamplebuffer.m
=====================================
@@ -45,10 +45,8 @@
 #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
     #define MIN_VISIONOS 1.0
     #define VISIONOS_API_AVAILABLE , visionos(MIN_VISIONOS)
-    #define VISIONOS_AVAILABLE , visionOS MIN_VISIONOS
 #else
     #define VISIONOS_API_AVAILABLE
-    #define VISIONOS_AVAILABLE
 #endif
 
 #pragma mark Private
@@ -525,7 +523,7 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
                     selector:@selector(flushedAutomatically:)
                         name:AVSampleBufferAudioRendererWasFlushedAutomaticallyNotification
                       object:nil];
-    if (@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0 VISIONOS_AVAILABLE, *))
+    if (@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *))
     {
         [notifCenter addObserver:self
                         selector:@selector(outputConfigurationChanged:)
@@ -619,7 +617,7 @@ Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
 static void
 Close(vlc_object_t *obj)
 {
-    if (@available(macOS MIN_MACOS, iOS MIN_IOS, tvOS MIN_TVOS, watchOS MIN_WATCHOS VISIONOS_AVAILABLE, *))
+    if (@available(macOS MIN_MACOS, iOS MIN_IOS, tvOS MIN_TVOS, watchOS MIN_WATCHOS, *))
     {
         audio_output_t *aout = (audio_output_t *)obj;
         /* Transfer ownership back from VLC to ARC so that it can be released. */
@@ -633,7 +631,7 @@ Open(vlc_object_t *obj)
 {
     audio_output_t *aout = (audio_output_t *)obj;
 
-    if (@available(macOS MIN_MACOS, iOS MIN_IOS, tvOS MIN_TVOS, watchOS MIN_WATCHOS VISIONOS_AVAILABLE, *))
+    if (@available(macOS MIN_MACOS, iOS MIN_IOS, tvOS MIN_TVOS, watchOS MIN_WATCHOS, *))
     {
         aout->sys = (__bridge_retained void*) [[VLCAVSample alloc] init:aout];
         if (aout->sys == nil)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1c918825b9c83c79fc7840c9d46fd398f2cc2437...9106f00f9008fde5deae21671e3c7c41c8ab77a5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1c918825b9c83c79fc7840c9d46fd398f2cc2437...9106f00f9008fde5deae21671e3c7c41c8ab77a5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list