]> Repos - portaudio/commitdiff
wasapi: fixed input device can not be opened in Exclusive mode (regression of previou...
authordmitrykos <dmitrykos@neutroncode.com>
Mon, 10 Sep 2018 19:55:27 +0000 (22:55 +0300)
committerdmitrykos <dmitrykos@neutroncode.com>
Mon, 10 Sep 2018 19:55:27 +0000 (22:55 +0300)
src/hostapi/wasapi/pa_win_wasapi.c

index fd57fd61ce5263aa5f6dec05d95983e6cb432101..36abc07becaf2a43654ef1c005508e72b15c039c 100644 (file)
@@ -2973,9 +2973,10 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
                &pSub->wavex.Format,
         NULL);
        
-       // Check if buffer size is the one we requested in Exclusive mode, for UAC1 USB DACs WASAPI allocates internal
-       // buffer equal to 8 times of pSub->period that has to be corrected in order to match the requested latency
-       if ((hr == S_OK) && (pSub->shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE))
+       // [Output only] Check if buffer size is the one we requested in Exclusive mode, for UAC1 USB DACs WASAPI 
+       // allocates internal buffer equal to 8 times of pSub->period that has to be corrected in order to match 
+       // the requested latency
+       if (output && (hr == S_OK) && (pSub->shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE))
        {
                UINT32 maxBufferSize = 0;