[10/16] winecoreaudio: Report when the render callback is just providing silence.

Ken Thomases ken at codeweavers.com
Thu Dec 21 03:49:24 CST 2006


This hint may allow the device driver to optimize when there's no sound
to play.
---
  dlls/winmm/winecoreaudio/audio.c |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c
index 4c99760..fb8c9cf 100644
--- a/dlls/winmm/winecoreaudio/audio.c
+++ b/dlls/winmm/winecoreaudio/audio.c
@@ -63,6 +63,11 @@ #include <CoreFoundation/CoreFoundation.
 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 */
@@ -1442,6 +1447,8 @@ OSStatus CoreAudio_woAudioUnitIOProc(voi
         }
         else
         {
+            if (!dataProvided)
+                *ioActionFlags |= kAudioUnitRenderAction_OutputIsSilence;
             memset((char*)ioData->mBuffers[0].mData + dataProvided, 0, dataNeeded);
             dataProvided += dataNeeded;
             dataNeeded = 0;


More information about the wine-patches mailing list