always disable wmme clip and dither if an spdif passthrough wave format is requested

This commit is contained in:
rossb 2009-03-08 08:10:55 +00:00
commit 5bf449b175
3 changed files with 15 additions and 2 deletions

View 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)

View 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,

View file

@ -182,7 +182,7 @@ int main(int argc, char* argv[])
&outputParameters,
SAMPLE_RATE,
FRAMES_PER_BUFFER,
paClipOff | paDitherOff, /* IMPORTANT must disable clipping and dithering for WMME AC3 */
0,
patestCallback,
&data );
if( err != paNoError ) goto error;