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

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


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 15 15:44:55 2019 +0200| [84134c554a4a3c5be78f818896a372a89bdaa792] | 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=84134c554a4a3c5be78f818896a372a89bdaa792
---

 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..072de41534 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