]> Repos - portaudio/commitdiff
wasapi:
authordmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 3 Aug 2010 21:02:52 +0000 (21:02 +0000)
committerdmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 3 Aug 2010 21:02:52 +0000 (21:02 +0000)
 - fixed compilation by MinGW, was failing due to double ambiguous jack describing enums used in KS
ds:
 - fixed compile by MinGW, was failing due to missing casts to LPVOID * and usage of UINT instead of DWORD by PaWinDsStream::previousPlayCursor

src/hostapi/dsound/pa_win_ds.c
src/hostapi/wasapi/pa_win_wasapi.c

index d491a1f9072f96e9513a10ec007febb60a68ffa9..c54f9802f3be0f11b0e021679cb02486fcabfd56 100644 (file)
@@ -244,7 +244,7 @@ typedef struct PaWinDsStream
     /* Try to detect play buffer underflows. */
     LARGE_INTEGER        perfCounterTicksPerBuffer; /* counter ticks it should take to play a full buffer */
     LARGE_INTEGER        previousPlayTime;
-    UINT                 previousPlayCursor;
+    DWORD                previousPlayCursor;
     UINT                 outputUnderflowCount;
     BOOL                 outputIsRunning;
     INT                  finalZeroBytesWritten; /* used to determine when we've flushed the whole buffer */
@@ -1502,10 +1502,10 @@ static HRESULT InitFullDuplexInputOutputBuffers( PaWinDsStream *stream,
 
         /* retrieve the pre ds 8 buffer interfaces which are used by the rest of the code */
 
-        hr = IUnknown_QueryInterface( pCaptureBuffer8, &IID_IDirectSoundCaptureBuffer, &stream->pDirectSoundInputBuffer );
+        hr = IUnknown_QueryInterface( pCaptureBuffer8, &IID_IDirectSoundCaptureBuffer, (LPVOID *)&stream->pDirectSoundInputBuffer );
         
         if( hr == DS_OK )
-            hr = IUnknown_QueryInterface( pRenderBuffer8, &IID_IDirectSoundBuffer, &stream->pDirectSoundOutputBuffer );
+            hr = IUnknown_QueryInterface( pRenderBuffer8, &IID_IDirectSoundBuffer, (LPVOID *)&stream->pDirectSoundOutputBuffer );
 
         /* release the ds 8 interfaces, we don't need them */
         IUnknown_Release( pCaptureBuffer8 );
index e3549288ffbf92d1c5b863850ce87334b78030f5..5177bc40b42e13fc8485a29e56170d6cbf6e43c7 100644 (file)
@@ -75,6 +75,8 @@
 \r
 #ifndef NTDDI_VERSION\r
 \r
+       #define NTDDI_VERSION 0x06000000 // NTDDI_VISTA\r
+\r
        #ifndef _AVRT_ //<< fix MinGW dummy compile by defining missing type: AVRT_PRIORITY\r
        typedef enum _AVRT_PRIORITY\r
        {\r
         #define NONAMELESSUNION\r
     #endif\r
 \r
+       #undef NTDDI_VERSION\r
     #undef WINVER\r
+    #define WINVER 0x0600\r
     #undef _WIN32_WINNT\r
+       #define _WIN32_WINNT 0x0600\r
     #include <sdkddkver.h>\r
     #include <propkeydef.h>\r
     #define COBJMACROS\r
     #include <mmdeviceapi.h>\r
     #include <endpointvolume.h>\r
     #include <functiondiscoverykeys.h>\r
+       #include <devicetopology.h>     // Used to get IKsJackDescription interface\r
     #undef INITGUID\r
 \r
 #endif // NTDDI_VERSION\r
@@ -636,13 +642,13 @@ static PaError __LogPaError(PaError err, const char *func, const char *file, int
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
-static double nano100ToMillis(REFERENCE_TIME ref)\r
+/*static double nano100ToMillis(REFERENCE_TIME ref)\r
 {\r
     //  1 nano = 0.000000001 seconds\r
     //100 nano = 0.0000001   seconds\r
     //100 nano = 0.0001   milliseconds\r
     return ((double)ref)*0.0001;\r
-}\r
+}*/\r
 \r
 // ------------------------------------------------------------------------------------------\r
 static double nano100ToSeconds(REFERENCE_TIME ref)\r
@@ -654,13 +660,13 @@ static double nano100ToSeconds(REFERENCE_TIME ref)
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
-static REFERENCE_TIME MillisTonano100(double ref)\r
+/*static REFERENCE_TIME MillisTonano100(double ref)\r
 {\r
     //  1 nano = 0.000000001 seconds\r
     //100 nano = 0.0000001   seconds\r
     //100 nano = 0.0001   milliseconds\r
     return (REFERENCE_TIME)(ref/0.0001);\r
-}\r
+}*/\r
 \r
 // ------------------------------------------------------------------------------------------\r
 static REFERENCE_TIME SecondsTonano100(double ref)\r
@@ -696,10 +702,10 @@ static WORD PaSampleFormatToBitsPerSample(PaSampleFormat format_id)
 \r
 // ------------------------------------------------------------------------------------------\r
 // Converts PaSampleFormat to bits per sample value\r
-static WORD PaSampleFormatToBytesPerSample(PaSampleFormat format_id)\r
+/*static WORD PaSampleFormatToBytesPerSample(PaSampleFormat format_id)\r
 {\r
        return PaSampleFormatToBitsPerSample(format_id) >> 3; // 'bits/8'\r
-}\r
+}*/\r
 \r
 // ------------------------------------------------------------------------------------------\r
 // Converts Hns period into number of frames\r
@@ -727,19 +733,19 @@ static UINT32 ALIGN_BWD(UINT32 v, UINT32 align)
 \r
 // ------------------------------------------------------------------------------------------\r
 // Aligns 'v' forward\r
-static UINT32 ALIGN_FWD(UINT32 v, UINT32 align)\r
+/*static UINT32 ALIGN_FWD(UINT32 v, UINT32 align)\r
 {\r
        UINT32 remainder = (align ? (v % align) : 0);\r
        if (remainder == 0)\r
                return v;\r
        return v + (align - remainder);\r
-}\r
+}*/\r
 \r
 // ------------------------------------------------------------------------------------------\r
 // Aligns WASAPI buffer to 128 byte packet boundary. HD Audio will fail to play if buffer\r
 // is misaligned. This problem was solved in Windows 7 were AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED\r
 // is thrown although we must align for Vista anyway.\r
-static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32 nBlockAlign, \r
+static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32 nBlockAlign,\r
                                                                   ALIGN_FUNC pAlignFunc)\r
 {\r
 #define HDA_PACKET_SIZE (128)\r
@@ -754,7 +760,7 @@ static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32
 \r
        frame_bytes = packets * HDA_PACKET_SIZE;\r
        nFrames     = frame_bytes / nBlockAlign;\r
-       \r
+\r
        return nFrames;\r
 \r
 #undef HDA_PACKET_SIZE\r
@@ -1000,7 +1006,7 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
         If COM is already initialized CoInitialize will either return\r
         FALSE, or RPC_E_CHANGED_MODE if it was initialised in a different\r
         threading mode. In either case we shouldn't consider it an error\r
-        but we need to be careful to not call CoUninitialize() if \r
+        but we need to be careful to not call CoUninitialize() if\r
         RPC_E_CHANGED_MODE was returned.\r
     */\r
     hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);\r
@@ -1361,7 +1367,7 @@ static void Terminate( PaUtilHostApiRepresentation *hostApi )
                DWORD calling_thread_id = GetCurrentThreadId();\r
                if (g_WasapiInitThread != calling_thread_id)\r
                {\r
-                       PRINT(("WASAPI: failed CoUninitializes calling thread[%d] does not match initializing thread[%d]\n", \r
+                       PRINT(("WASAPI: failed CoUninitializes calling thread[%d] does not match initializing thread[%d]\n",\r
                                calling_thread_id, g_WasapiInitThread));\r
                }\r
                else\r
@@ -1536,8 +1542,8 @@ static PaSampleFormat WaveToPaFormat(const WAVEFORMATEXTENSIBLE *in)
             }\r
         }\r
                break; }\r
-    \r
-    case WAVE_FORMAT_IEEE_FLOAT: \r
+\r
+    case WAVE_FORMAT_IEEE_FLOAT:\r
                return paFloat32;\r
 \r
     case WAVE_FORMAT_PCM: {\r
@@ -1624,7 +1630,7 @@ static PaError MakeWaveFormatFromParams(WAVEFORMATEXTENSIBLE *wavex, const PaStr
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
-static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount)\r
+/*static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount)\r
 {\r
     PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat ));\r
     PA_DEBUG(( "sampleRate = %f\n" , sampleRate ));\r
@@ -1670,7 +1676,7 @@ static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sample
         pwfext->SubFormat = pa_KSDATAFORMAT_SUBTYPE_PCM;\r
     }\r
     pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign;\r
-}\r
+}*/\r
 \r
 // ------------------------------------------------------------------------------------------\r
 static PaError GetClosestFormat(IAudioClient *myClient, double sampleRate,\r
@@ -1985,11 +1991,11 @@ static void _RecalculateBuffersCount(PaWasapiSubStream *sub, UINT32 userFramesPe
        // - For Shared mode we use double buffering.\r
        if ((sub->shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) || fullDuplex)\r
        {\r
-               // Exclusive mode does not allow >1 buffers be used for Event interface, e.g. GetBuffer \r
+               // Exclusive mode does not allow >1 buffers be used for Event interface, e.g. GetBuffer\r
                // call must acquire max buffer size and it all must be processed.\r
                if (sub->streamFlags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)\r
                        sub->userBufferAndHostMatch = 1;\r
-               \r
+\r
                // Use paUtilBoundedHostBufferSize because exclusive mode will starve and produce\r
                // bad quality of audio\r
                sub->buffers = 1;\r
@@ -1997,7 +2003,7 @@ static void _RecalculateBuffersCount(PaWasapiSubStream *sub, UINT32 userFramesPe
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
-static void _CalculateAlignedPeriod(PaWasapiSubStream *pSub, UINT32 *nFramesPerLatency, \r
+static void _CalculateAlignedPeriod(PaWasapiSubStream *pSub, UINT32 *nFramesPerLatency,\r
                                                                        ALIGN_FUNC pAlignFunc)\r
 {\r
        // Align frames to HD Audio packet size of 128 bytes for Exclusive mode only.\r
@@ -2015,8 +2021,8 @@ static void _CalculateAlignedPeriod(PaWasapiSubStream *pSub, UINT32 *nFramesPerL
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
-static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSub, \r
-       PaWasapiDeviceInfo *pInfo, const PaStreamParameters *params, UINT32 framesPerLatency, \r
+static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSub,\r
+       PaWasapiDeviceInfo *pInfo, const PaStreamParameters *params, UINT32 framesPerLatency,\r
        double sampleRate, BOOL blocking, BOOL output, BOOL fullDuplex, PaError *pa_error)\r
 {\r
        PaError error;\r
@@ -2071,10 +2077,10 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
        framesPerLatency += MakeFramesFromHns(SecondsTonano100(params->suggestedLatency), pSub->wavex.Format.nSamplesPerSec);\r
 #else\r
        // Calculate host buffer size\r
-       if ((pSub->shareMode != AUDCLNT_SHAREMODE_EXCLUSIVE) && \r
+       if ((pSub->shareMode != AUDCLNT_SHAREMODE_EXCLUSIVE) &&\r
                (!pSub->streamFlags || ((pSub->streamFlags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) == 0)))\r
        {\r
-               framesPerLatency = PaUtil_GetFramesPerHostBuffer(userFramesPerBuffer, \r
+               framesPerLatency = PaUtil_GetFramesPerHostBuffer(userFramesPerBuffer,\r
                        params->suggestedLatency, pSub->wavex.Format.nSamplesPerSec, 0/*,\r
                        (pSub->streamFlags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK ? 0 : 1)*/);\r
        }\r
@@ -2084,13 +2090,13 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
 \r
                // Work 1:1 with user buffer (only polling allows to use >1)\r
                framesPerLatency += MakeFramesFromHns(SecondsTonano100(params->suggestedLatency), pSub->wavex.Format.nSamplesPerSec);\r
-               \r
+\r
                // Use Polling if overall latency is > 5ms as it allows to use 100% CPU in a callback,\r
                // or user specified latency parameter\r
                overall = MakeHnsPeriod(framesPerLatency, pSub->wavex.Format.nSamplesPerSec);\r
                if ((overall > 50000) || (params->suggestedLatency > 0))\r
                {\r
-                       framesPerLatency = PaUtil_GetFramesPerHostBuffer(userFramesPerBuffer, \r
+                       framesPerLatency = PaUtil_GetFramesPerHostBuffer(userFramesPerBuffer,\r
                                params->suggestedLatency, pSub->wavex.Format.nSamplesPerSec, 0/*,\r
                                (streamFlags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK ? 0 : 1)*/);\r
 \r
@@ -2132,8 +2138,8 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
        */\r
        {\r
                /*!     AUDCLNT_E_BUFFER_SIZE_ERROR: Applies to Windows 7 and later.\r
-                       Indicates that the buffer duration value requested by an exclusive-mode client is \r
-                       out of range. The requested duration value for pull mode must not be greater than \r
+                       Indicates that the buffer duration value requested by an exclusive-mode client is\r
+                       out of range. The requested duration value for pull mode must not be greater than\r
                        500 milliseconds; for push mode the duration value must not be greater than 2 seconds.\r
                */\r
                if (pSub->shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)\r
@@ -2176,7 +2182,7 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
         NULL);\r
 \r
        /*! WASAPI is tricky on large device buffer, sometimes 2000ms can be allocated sometimes\r
-           less. There is no known guaranteed level thus we make subsequent tries by decreasing \r
+           less. There is no known guaranteed level thus we make subsequent tries by decreasing\r
                buffer by 100ms per try.\r
        */\r
        while ((hr == E_OUTOFMEMORY) && (pSub->period > (100 * 10000)))\r
@@ -2326,9 +2332,9 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
     IAudioClient_AddRef(pSub->client);\r
 \r
        // Recalculate buffers count\r
-       _RecalculateBuffersCount(pSub, \r
-               userFramesPerBuffer, \r
-               MakeFramesFromHns(pSub->period, pSub->wavex.Format.nSamplesPerSec), \r
+       _RecalculateBuffersCount(pSub,\r
+               userFramesPerBuffer,\r
+               MakeFramesFromHns(pSub->period, pSub->wavex.Format.nSamplesPerSec),\r
                fullDuplex);\r
 \r
 done:\r
@@ -2502,7 +2508,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
                stream->in.framesPerHostCallback = maxBufferSize;\r
 \r
                // Calculate frames per single buffer, if buffers > 1 then always framesPerBuffer\r
-               stream->in.framesPerBuffer = \r
+               stream->in.framesPerBuffer =\r
                        (stream->in.userBufferAndHostMatch ? stream->in.framesPerHostCallback : framesPerBuffer);\r
 \r
                // Calculate buffer latency\r
@@ -2616,7 +2622,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
                stream->out.framesPerHostCallback = maxBufferSize;\r
 \r
                // Calculate frames per single buffer, if buffers > 1 then always framesPerBuffer\r
-               stream->out.framesPerBuffer = \r
+               stream->out.framesPerBuffer =\r
                        (stream->out.userBufferAndHostMatch ? stream->out.framesPerHostCallback : framesPerBuffer);\r
 \r
                // Calculate buffer latency\r
@@ -2677,7 +2683,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
        {\r
                // serious problem #1 - No, Not a problem, especially concerning Exclusive mode.\r
                // Input device in exclusive mode somehow is getting large buffer always, thus we\r
-               // adjust Output latency to reflect it, thus period will differ but playback will be \r
+               // adjust Output latency to reflect it, thus period will differ but playback will be\r
                // normal.\r
                /*if (stream->in.period != stream->out.period)\r
                {\r
@@ -2708,7 +2714,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
        else\r
        if (outputParameters)\r
        {\r
-               if ((stream->out.buffers == 1) && \r
+               if ((stream->out.buffers == 1) &&\r
                        (!stream->out.streamFlags || ((stream->out.streamFlags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) == 0)))\r
                        bufferMode = paUtilBoundedHostBufferSize;\r
        }\r
@@ -3035,10 +3041,10 @@ static PaError ReadStream( PaStream* s, void *_buffer, unsigned long _frames )
 \r
                // Register available frames to processor\r
         PaUtil_SetInputFrameCount(&stream->bufferProcessor, frames);\r
-               \r
+\r
                // Register host buffer pointer to processor\r
         PaUtil_SetInterleavedInputChannels(&stream->bufferProcessor, 0, wasapi_buffer, stream->bufferProcessor.inputChannelCount);\r
-               \r
+\r
                // Copy user data to host buffer (with conversion if applicable)\r
                processed = PaUtil_CopyInput(&stream->bufferProcessor, (void **)&user_buffer, frames);\r
 \r
@@ -3184,10 +3190,10 @@ static PaError WriteStream( PaStream* s, const void *_buffer, unsigned long _fra
 \r
                        // Register available frames to processor\r
             PaUtil_SetOutputFrameCount(&stream->bufferProcessor, available);\r
-                       \r
+\r
                        // Register host buffer pointer to processor\r
             PaUtil_SetInterleavedOutputChannels(&stream->bufferProcessor, 0, wasapi_buffer,    stream->bufferProcessor.outputChannelCount);\r
-                       \r
+\r
                        // Copy user data to host buffer (with conversion if applicable)\r
                        processed = PaUtil_CopyOutput(&stream->bufferProcessor, (const void **)&user_buffer, available);\r
 \r
@@ -3497,7 +3503,7 @@ PaError PaWasapi_GetJackCount(PaDeviceIndex nDevice, int *jcount)
                return paInvalidDevice;\r
 \r
        // Get the endpoint device's IDeviceTopology interface.\r
-       hr = IMMDevice_Activate(paWasapi->devInfo[index].device, &pa_IID_IDeviceTopology, \r
+       hr = IMMDevice_Activate(paWasapi->devInfo[index].device, &pa_IID_IDeviceTopology,\r
                CLSCTX_INPROC_SERVER, NULL, (void**)&pDeviceTopology);\r
        IF_FAILED_JUMP(hr, error);\r
 \r
@@ -3550,7 +3556,11 @@ static PaWasapiJackConnectionType ConvertJackConnectionTypeWASAPIToPA(int connTy
        switch (connType)\r
        {\r
                case eConnTypeUnknown:                  return eJackConnTypeUnknown;\r
+#ifdef _KS_\r
                case eConnType3Point5mm:                return eJackConnType3Point5mm;\r
+#else\r
+               case eConnTypeEighth:               return eJackConnType3Point5mm;\r
+#endif\r
                case eConnTypeQuarter:                  return eJackConnTypeQuarter;\r
                case eConnTypeAtapiInternal:    return eJackConnTypeAtapiInternal;\r
                case eConnTypeRCA:                              return eJackConnTypeRCA;\r
@@ -3576,7 +3586,11 @@ static PaWasapiJackGeoLocation ConvertJackGeoLocationWASAPIToPA(int geoLoc)
        case eGeoLocRight:                              return eJackGeoLocRight;\r
        case eGeoLocTop:                                return eJackGeoLocTop;\r
        case eGeoLocBottom:                             return eJackGeoLocBottom;\r
+#ifdef _KS_\r
        case eGeoLocRearPanel:                  return eJackGeoLocRearPanel;\r
+#else\r
+       case eGeoLocRearOPanel:         return eJackGeoLocRearPanel;\r
+#endif\r
        case eGeoLocRiser:                              return eJackGeoLocRiser;\r
        case eGeoLocInsideMobileLid:    return eJackGeoLocInsideMobileLid;\r
        case eGeoLocDrivebay:                   return eJackGeoLocDrivebay;\r
@@ -3594,7 +3608,11 @@ static PaWasapiJackGenLocation ConvertJackGenLocationWASAPIToPA(int genLoc)
        {\r
        case eGenLocPrimaryBox: return eJackGenLocPrimaryBox;\r
        case eGenLocInternal:   return eJackGenLocInternal;\r
+#ifdef _KS_\r
        case eGenLocSeparate:   return eJackGenLocSeparate;\r
+#else\r
+       case eGenLocSeperate:   return eJackGenLocSeparate;\r
+#endif\r
        case eGenLocOther:              return eJackGenLocOther;\r
        }\r
        return eJackGenLocPrimaryBox;\r
@@ -3643,7 +3661,7 @@ PaError PaWasapi_GetJackDescription(PaDeviceIndex nDevice, int jindex, PaWasapiJ
                return paInvalidDevice;\r
 \r
        // Get the endpoint device's IDeviceTopology interface.\r
-       hr = IMMDevice_Activate(paWasapi->devInfo[index].device, &pa_IID_IDeviceTopology, \r
+       hr = IMMDevice_Activate(paWasapi->devInfo[index].device, &pa_IID_IDeviceTopology,\r
                CLSCTX_INPROC_SERVER, NULL, (void**)&pDeviceTopology);\r
        IF_FAILED_JUMP(hr, error);\r
 \r
@@ -4027,7 +4045,7 @@ thread_error:
 static HRESULT PollGetOutputFramesAvailable(PaWasapiStream *stream, UINT32 *available)\r
 {\r
        HRESULT hr;\r
-       UINT32 frames  = stream->out.framesPerHostCallback, \r
+       UINT32 frames  = stream->out.framesPerHostCallback,\r
                   padding = 0;\r
 \r
        (*available) = 0;\r
@@ -4038,7 +4056,7 @@ static HRESULT PollGetOutputFramesAvailable(PaWasapiStream *stream, UINT32 *avai
 \r
        // get available\r
        frames -= padding;\r
-       \r
+\r
        // set\r
        (*available) = frames;\r
        return hr;\r
@@ -4057,7 +4075,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
        DWORD sleep_ms     = 0;\r
        DWORD sleep_ms_in  = GetFramesSleepTime(stream->in.framesPerBuffer, stream->in.wavex.Format.nSamplesPerSec);\r
        DWORD sleep_ms_out = GetFramesSleepTime(stream->out.framesPerBuffer, stream->out.wavex.Format.nSamplesPerSec);\r
-       \r
+\r
        // Adjust polling time\r
        if (stream->bufferMode != paUtilFixedHostBufferSize)\r
        {\r
@@ -4065,7 +4083,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
                sleep_ms_out = GetFramesSleepTime(stream->bufferProcessor.framesPerUserBuffer, stream->out.wavex.Format.nSamplesPerSec);\r
        }\r
 \r
-       // Choose smallest      \r
+       // Choose smallest\r
        if ((sleep_ms_in != 0) && (sleep_ms_out != 0))\r
                sleep_ms = min(sleep_ms_in, sleep_ms_out);\r
        else\r
@@ -4141,7 +4159,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
             else\r
                        {\r
                                LogHostError(hr); // not fatal, just log\r
-                       }            \r
+                       }\r
                }\r
 \r
                // Start\r
@@ -4188,7 +4206,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
                                                LogHostError(hr);\r
                                                break;\r
                                        }\r
-                                       \r
+\r
                                        // output\r
                                        if (stream->bufferMode == paUtilFixedHostBufferSize)\r
                                        {\r