]> Repos - portaudio/commitdiff
wasapi:
authordmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Mon, 12 Apr 2010 21:15:50 +0000 (21:15 +0000)
committerdmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Mon, 12 Apr 2010 21:15:50 +0000 (21:15 +0000)
 - improved device buffer alignment calculation allowing to set as precise device latency as possible

src/hostapi/wasapi/pa_win_wasapi.c

index 2e26f7671dfc2e6d883ac2beca88d4812b8751a5..11714c049c2daa23377c8b513c08cecbe13afa70 100644 (file)
@@ -701,7 +701,7 @@ static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32
 {\r
 #define HDA_PACKET_SIZE 128\r
 \r
-       long packets_total = 10000 * (nSamplesPerSec * nBlockAlign / HDA_PACKET_SIZE);\r
+       //long packets_total = 10000 * (nSamplesPerSec * nBlockAlign / HDA_PACKET_SIZE);\r
        long frame_bytes   = nFrames * nBlockAlign;\r
        long packets;\r
 \r
@@ -711,10 +711,10 @@ static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32
        packets      = frame_bytes / HDA_PACKET_SIZE;\r
 \r
        // align to packets count\r
-       while (packets && ((packets_total % packets) != 0))\r
+       /*while (packets && ((packets_total % packets) != 0))\r
        {\r
                --packets;\r
-       }\r
+       }*/\r
 \r
        frame_bytes = packets * HDA_PACKET_SIZE;\r
        nFrames     = frame_bytes / nBlockAlign;\r