]> Repos - portaudio/commitdiff
always disable wmme clip and dither if an spdif passthrough wave format is requested
authorrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 8 Mar 2009 08:10:55 +0000 (08:10 +0000)
committerrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 8 Mar 2009 08:10:55 +0000 (08:10 +0000)
include/pa_win_wmme.h
src/hostapi/wmme/pa_win_wmme.c
test/patest_wmme_ac3.c

index fa06944b293cee2d827663b95c797bfc185a3c1d..ee7c54de639afd812aff5874a18a902e7ec389a6 100644 (file)
@@ -53,6 +53,10 @@ extern "C"
 #endif /* __cplusplus */
 
 
+/* The following are flags which can be set in 
+  PaWinMmeStreamInfo's flags field.
+*/
+
 #define paWinMmeUseLowLevelLatencyParameters            (0x01)
 #define paWinMmeUseMultipleDevices                      (0x02)  /* use mme specific multiple device feature */
 #define paWinMmeUseChannelMask                          (0x04)
@@ -64,7 +68,8 @@ extern "C"
 */
 #define paWinMmeDontThrottleOverloadedProcessingThread  (0x08)
 
-/* flags for non-PCM spdif passthrough */
+/*  Flags for non-PCM spdif passthrough.
+*/
 #define paWinMmeWaveFormatDolbyAc3Spdif                 (0x10)
 #define paWinMmeWaveFormatWmaSpdif                      (0x20)
 
index d987a9db01999c63e3c4847be5a5138e4f1b6412..06c525b2baa92415b3c5963348a0fc732838439a 100644 (file)
@@ -2389,6 +2389,14 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
         return paInvalidFlag; /* unexpected platform specific flag */
 
 
+    /* always disable clipping and dithering if we are outputting a raw spdif stream */
+    if( (winMmeSpecificOutputFlags & paWinMmeWaveFormatDolbyAc3Spdif)
+            || (winMmeSpecificOutputFlags & paWinMmeWaveFormatWmaSpdif) ){
+
+        streamFlags = streamFlags | paClipOff | paDitherOff;
+    }
+
+
     result = CalculateBufferSettings( &framesPerHostInputBuffer, &hostInputBufferCount,
                 &framesPerHostOutputBuffer, &hostOutputBufferCount,
                 inputChannelCount, hostInputSampleFormat, suggestedInputLatency, inputStreamInfo,
index 9823db6014d64025cbf3725cbf313dc06a7a65be..a0c0e1bae2c70bb5fa39d7be80162a0b3c0d3f5d 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char* argv[])
               &outputParameters,\r
               SAMPLE_RATE,\r
               FRAMES_PER_BUFFER,\r
-              paClipOff | paDitherOff,  /* IMPORTANT must disable clipping and dithering for WMME AC3 */\r
+              0,\r
               patestCallback,\r
               &data );\r
     if( err != paNoError ) goto error;\r