[vlc-commits] [Git][videolan/vlc][master] 3 commits: apple: avaudiosession: don't always log downmixing warning

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jun 5 13:16:14 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e1eabbde by Thomas Guillem at 2024-06-05T13:01:40+00:00
apple: avaudiosession: don't always log downmixing warning

In case of spatial_audio:
 - setPreferredOutputNumberOfChannels:2
 - setSupportsMultichannelContent:Yes

Don't print a warning saying it will be downmixed when it will be
"spatialized".

- - - - -
6f576c95 by Thomas Guillem at 2024-06-05T13:01:40+00:00
apple: channel_layout: fix stereo on xros via avsb

- - - - -
c0ea8ba0 by Thomas Guillem at 2024-06-05T13:01:40+00:00
apple: channel_layout: use kAudioChannelLayoutTag_StereoHeadphones

No more infos than: "A standard stereo stream; headphone playback
implied."

- - - - -


2 changed files:

- modules/audio_output/apple/avaudiosession_common.m
- modules/audio_output/apple/channel_layout.c


Changes:

=====================================
modules/audio_output/apple/avaudiosession_common.m
=====================================
@@ -52,8 +52,9 @@ avas_PrepareFormat(audio_output_t *p_aout, AVAudioSession *instance,
     /* Increase the preferred number of output channels if possible */
     if (channel_count > max_channel_count)
     {
-        msg_Warn(p_aout, "Requested channel count %u not fully supported, "
-                 "downmixing to %ld\n", channel_count, (long)max_channel_count);
+        if (!spatial_audio)
+            msg_Warn(p_aout, "Requested channel count %u not fully supported, "
+                     "downmixing to %ld\n", channel_count, (long)max_channel_count);
         channel_count = max_channel_count;
     }
 


=====================================
modules/audio_output/apple/channel_layout.c
=====================================
@@ -66,8 +66,30 @@ channel_layout_MapFromVLC(audio_output_t *p_aout, const audio_sample_format_t *f
                           AudioChannelLayout **inlayoutp, size_t *inlayout_size)
 {
     unsigned channels = aout_FormatNbChannels(fmt);
-
     size_t size;
+
+    /* Stereo on xros via avsb doesn't work with the UseChannelDescriptions
+     * tag, so use Mono and Stereo tags. */
+    if (channels <= 2)
+    {
+        size = sizeof(AudioChannelLayout);
+        AudioChannelLayout *inlayout = malloc(size);
+        if (inlayout == NULL)
+            return VLC_ENOMEM;
+        *inlayoutp = inlayout;
+        *inlayout_size = size;
+
+        if (channels == 1)
+            inlayout->mChannelLayoutTag = kAudioChannelLayoutTag_Mono;
+        else
+            inlayout->mChannelLayoutTag =
+                p_aout->current_sink_info.headphones ?
+                    kAudioChannelLayoutTag_StereoHeadphones :
+                    kAudioChannelLayoutTag_Stereo;
+
+        return VLC_SUCCESS;
+    }
+
     if (ckd_mul(&size, channels, sizeof(AudioChannelDescription)) ||
         ckd_add(&size, size, sizeof(AudioChannelLayout)))
         return VLC_ENOMEM;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a2cc24400faee2d93a480fac63883017c4fd9873...c0ea8ba07dc315ca7034d11dc03736cffeb23f76

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a2cc24400faee2d93a480fac63883017c4fd9873...c0ea8ba07dc315ca7034d11dc03736cffeb23f76
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