[vlc-commits] auhal: fix wrong host time with SPDIF render callbacks

Thomas Guillem git at videolan.org
Wed Jul 22 09:52:06 CEST 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 21 14:18:33 2020 +0200| [9353448cd4fca0eead8ffbbccb81d893f6bd4a56] | committer: Thomas Guillem

auhal: fix wrong host time with SPDIF render callbacks

This caused a freeze as the aout returned infinite values from time_get() with
SPDIF output.

Indeed, the inNow time is in the past (time when the callback is executed) and
a substraction with mach_absolute_time() returned a negative value.

The issue is revealed by 303d12153f67742ac21a31efb1eeb1f4aaa04f08 but the
SPDIF host time had always been wrong.

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

 modules/audio_output/auhal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index ab614c92a0..f99acfc27e 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -978,8 +978,8 @@ RenderCallbackSPDIF(AudioDeviceID inDevice, const AudioTimeStamp * inNow,
     uint8_t *p_output = outOutputData->mBuffers[p_sys->i_stream_index].mData;
     size_t i_size = outOutputData->mBuffers[p_sys->i_stream_index].mDataByteSize;
 
-    uint64_t i_host_time = (inNow->mFlags & kAudioTimeStampHostTimeValid)
-                         ? inNow->mHostTime : 0;
+    uint64_t i_host_time = (inOutputTime->mFlags & kAudioTimeStampHostTimeValid)
+                         ? inOutputTime->mHostTime : 0;
 
     ca_Render(p_aout, 0, i_host_time, p_output, i_size);
 



More information about the vlc-commits mailing list