Commit 0d567ff9 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

winmm: Also track input device position.

parent 1ed42313
......@@ -133,6 +133,7 @@ static void wave_in_test_deviceIn(int device, LPWAVEFORMATEX pwfx, DWORD format,
WAVEHDR frag;
MMRESULT rc;
DWORD res;
MMTIME mmt;
WORD nChannels = pwfx->nChannels;
WORD wBitsPerSample = pwfx->wBitsPerSample;
DWORD nSamplesPerSec = pwfx->nSamplesPerSec;
......@@ -224,6 +225,12 @@ static void wave_in_test_deviceIn(int device, LPWAVEFORMATEX pwfx, DWORD format,
"frag.dwBytesRecorded=%d, should=%d\n",
frag.dwBytesRecorded,pwfx->nAvgBytesPerSec);
mmt.wType = TIME_SAMPLES;
rc=waveInGetPosition(win, &mmt, sizeof(mmt));
ok(rc==MMSYSERR_NOERROR,"waveInGetPosition(%s): rc=%s\n",
dev_name(device),wave_in_error(rc));
ok(mmt.u.cb == frag.dwBytesRecorded, "Got wrong position: %u\n", mmt.u.cb);
/* stop playing on error */
if (res!=WAIT_OBJECT_0) {
rc=waveInStop(win);
......
......@@ -1495,6 +1495,8 @@ static void WID_PullACMData(WINMM_Device *device)
hr = IAudioCaptureClient_ReleaseBuffer(device->capture, packet);
if(FAILED(hr))
ERR("ReleaseBuffer failed: %08x\n", hr);
device->played_frames += packet;
}
queue = device->first;
......@@ -1602,6 +1604,8 @@ static void WID_PullData(WINMM_Device *device)
hr = IAudioCaptureClient_ReleaseBuffer(device->capture, packet_len);
if(FAILED(hr))
ERR("ReleaseBuffer failed: %08x\n", hr);
device->played_frames += packet_len;
}
exit:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment