summaryrefslogtreecommitdiff
path: root/audio/sysvad/EndpointsCommon/minwavertstream.cpp
diff options
context:
space:
mode:
authorDaniel Rugerio <[email protected]>2020-05-13 16:23:40 -0700
committerGitHub <[email protected]>2020-05-13 16:23:40 -0700
commitbf0b0fe11d8b301cdfcc6d13f12a778cdd1c14b5 (patch)
tree55938bebdfe634226f0c1ee7822cbcdb4879f975 /audio/sysvad/EndpointsCommon/minwavertstream.cpp
parentb78312cfe7990524cb46a1453ad2e013586857a0 (diff)
Update to SysVAD, Wave test and public sample of KS Position Test (#496)147237
* Update to Wave test and public sample of KS Position test. * Update to the SysVAD audio driver sample. * Add the PnpLockDown property.
Diffstat (limited to 'audio/sysvad/EndpointsCommon/minwavertstream.cpp')
-rw-r--r--audio/sysvad/EndpointsCommon/minwavertstream.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/sysvad/EndpointsCommon/minwavertstream.cpp b/audio/sysvad/EndpointsCommon/minwavertstream.cpp
index 93ecdcf3..499d5b38 100644
--- a/audio/sysvad/EndpointsCommon/minwavertstream.cpp
+++ b/audio/sysvad/EndpointsCommon/minwavertstream.cpp
@@ -968,12 +968,12 @@ NTSTATUS CMiniportWaveRTStream::GetReadPacket
// Return next packet number to be read
*PacketNumber = availablePacketNumber;
- // Compute and return timestamp corresponding to start of the available packet. In a real hardware
+ // Compute and return timestamp corresponding to the end of the available packet. In a real hardware
// driver, the timestamp would be computed in a driver and hardware specific manner. In this sample
// driver, it is extrapolated from the sample driver's internal simulated position correlation
// [m_ullLinearPosition @ m_ullDmaTimeStamp] and the sample's internal 64-bit packet counter, subtracting
// 1 from the packet counter to compute the time at the start of that last completed packet.
- ULONGLONG linearPositionOfAvailablePacket = (packetCounter - 1) * (m_ulDmaBufferSize / m_ulNotificationsPerBuffer);
+ ULONGLONG linearPositionOfAvailablePacket = packetCounter * (m_ulDmaBufferSize / m_ulNotificationsPerBuffer);
// Need to divide by (1000 * 10000 because m_ulDmaMovementRate is average bytes per sec
ULONGLONG carryForwardBytes = (hnsElapsedTimeCarryForward * m_ulDmaMovementRate) / 10000000;
ULONGLONG deltaLinearPosition = ullLinearPosition + carryForwardBytes - linearPositionOfAvailablePacket;