From db64c3964f9377ffa990784edf24a5e69fdc3b75 Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Tue, 22 Nov 2022 16:23:41 +0100 Subject: [PATCH] coreaudio: assert that frames match bytes --- modules/audio_output/coreaudio_common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c index 5c1ccd57520f..5239363f114f 100644 --- a/modules/audio_output/coreaudio_common.c +++ b/modules/audio_output/coreaudio_common.c @@ -425,13 +425,18 @@ RenderCallback(void *p_data, AudioUnitRenderActionFlags *ioActionFlags, VLC_UNUSED(ioActionFlags); VLC_UNUSED(inTimeStamp); VLC_UNUSED(inBusNumber); + + audio_output_t * p_aout = p_data; + struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys; + + assert(inNumberFrames == BytesToFrames(p_sys, ioData->mBuffers[0].mDataByteSize)); VLC_UNUSED(inNumberFrames); uint64_t i_host_time = (inTimeStamp->mFlags & kAudioTimeStampHostTimeValid) ? inTimeStamp->mHostTime : 0; bool is_silence; - ca_Render(p_data, i_host_time, ioData->mBuffers[0].mData, + ca_Render(p_aout, i_host_time, ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize, &is_silence); if (is_silence) *ioActionFlags |= kAudioUnitRenderAction_OutputIsSilence;