From 14d09847a3fff06ba18e67509d1af5a14742f696 Mon Sep 17 00:00:00 2001 From: dmitrykos Date: Mon, 12 Apr 2010 21:15:50 +0000 Subject: [PATCH] wasapi: - improved device buffer alignment calculation allowing to set as precise device latency as possible --- src/hostapi/wasapi/pa_win_wasapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.43.0