From: dmitrykos Date: Mon, 12 Apr 2010 21:15:50 +0000 (+0000) Subject: wasapi: X-Git-Tag: pa_stable_v19_20110326_r1647~139 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=14d09847a3fff06ba18e67509d1af5a14742f696;p=portaudio wasapi: - improved device buffer alignment calculation allowing to set as precise device latency as possible --- diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c index 2e26f76..11714c0 100644 --- a/src/hostapi/wasapi/pa_win_wasapi.c +++ b/src/hostapi/wasapi/pa_win_wasapi.c @@ -701,7 +701,7 @@ static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32 { #define HDA_PACKET_SIZE 128 - long packets_total = 10000 * (nSamplesPerSec * nBlockAlign / HDA_PACKET_SIZE); + //long packets_total = 10000 * (nSamplesPerSec * nBlockAlign / HDA_PACKET_SIZE); long frame_bytes = nFrames * nBlockAlign; long packets; @@ -711,10 +711,10 @@ static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32 packets = frame_bytes / HDA_PACKET_SIZE; // align to packets count - while (packets && ((packets_total % packets) != 0)) + /*while (packets && ((packets_total % packets) != 0)) { --packets; - } + }*/ frame_bytes = packets * HDA_PACKET_SIZE; nFrames = frame_bytes / nBlockAlign;