From: dmitrykos Date: Sat, 6 Nov 2010 01:16:34 +0000 (+0000) Subject: wasapi: fixed audio stream failing to open on Windows 7 in Exclusive mode if suggeste... X-Git-Tag: pa_stable_v19_20110326_r1647~79 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=7b3d837bbbcda0ac9b12850da67dca11a041bb7b;p=portaudio wasapi: fixed audio stream failing to open on Windows 7 in Exclusive mode if suggestedLatency parameter is 0 and user framesPerBuffer is less than 3 milliseconds --- diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c index cff3abd..9d48f34 100644 --- a/src/hostapi/wasapi/pa_win_wasapi.c +++ b/src/hostapi/wasapi/pa_win_wasapi.c @@ -632,13 +632,13 @@ static UINT32 ALIGN_BWD(UINT32 v, UINT32 align) // ------------------------------------------------------------------------------------------ // Aligns 'v' forward -/*static UINT32 ALIGN_FWD(UINT32 v, UINT32 align) +static UINT32 ALIGN_FWD(UINT32 v, UINT32 align) { UINT32 remainder = (align ? (v % align) : 0); if (remainder == 0) return v; return v + (align - remainder); -}*/ +} // ------------------------------------------------------------------------------------------ // Aligns WASAPI buffer to 128 byte packet boundary. HD Audio will fail to play if buffer @@ -2056,7 +2056,7 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu pSub->period = pInfo->MinimumDevicePeriod; // Recalculate aligned period framesPerLatency = MakeFramesFromHns(pSub->period, pSub->wavex.Format.nSamplesPerSec); - _CalculateAlignedPeriod(pSub, &framesPerLatency, ALIGN_BWD); + _CalculateAlignedPeriod(pSub, &framesPerLatency, ALIGN_FWD); } }