[vlc-commits] audiounit_ios: add support for > 48kHz sample rate

Thomas Guillem git at videolan.org
Tue Oct 15 15:52:15 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 15 15:44:55 2019 +0200| [5ff335d6fda93dcc0c933b488ef4ba8c23b3d5cf] | committer: Thomas Guillem

audiounit_ios: add support for > 48kHz sample rate

Call setPreferredSampleRate() to setup the rate of the input. Failure is OK
since it will fallback to a normal samplerate.

Tested on a USB DAC with 96kHz support, but it should also work via HDMI.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ff335d6fda93dcc0c933b488ef4ba8c23b3d5cf
---

 modules/audio_output/audiounit_ios.m | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m
index 970b62a0f0..da255765b1 100644
--- a/modules/audio_output/audiounit_ios.m
+++ b/modules/audio_output/audiounit_ios.m
@@ -500,6 +500,13 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
      * should correspond to this number */
     avas_setPreferredNumberOfChannels(p_aout, fmt);
 
+    bool success = [p_sys->avInstance setPreferredSampleRate:fmt->i_rate error:nil];
+    if (!success)
+    {
+        /* Not critical, we can use any sample rates */
+        msg_Dbg(p_aout, "failed to set preferred sample rate");
+    }
+
     enum port_type port_type;
     int ret = avas_GetOptimalChannelLayout(p_aout, &port_type, &layout);
     if (ret != VLC_SUCCESS)



More information about the vlc-commits mailing list