From 0bb13dd31c40eeda294935285629fced1f6fa3bd Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Thu, 21 Dec 2006 03:49:24 -0600 Subject: [PATCH] winecoreaudio: Report when the render callback is just providing silence. --- dlls/winmm/winecoreaudio/audio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index c967ebb5faa..ae1067a96e2 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -63,6 +63,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave); typedef void *AudioUnit; /* From AudioUnit/AUComponents.h */ +enum +{ + kAudioUnitRenderAction_OutputIsSilence = (1 << 4), + /* provides hint on return from Render(): if set the buffer contains all zeroes */ +}; typedef UInt32 AudioUnitRenderActionFlags; /* only allow 10 output devices through this driver, this ought to be adequate */ @@ -1441,6 +1446,8 @@ OSStatus CoreAudio_woAudioUnitIOProc(void *inRefCon, } else { + if (!dataProvided) + *ioActionFlags |= kAudioUnitRenderAction_OutputIsSilence; memset((char*)ioData->mBuffers[0].mData + dataProvided, 0, dataNeeded); dataProvided += dataNeeded; dataNeeded = 0;