Commit d8d4aed8 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

winmm: GetCurrentPadding is superfluous while recording.

parent 88d75f11
...@@ -1453,19 +1453,11 @@ static void WID_PullACMData(WINMM_Device *device) ...@@ -1453,19 +1453,11 @@ static void WID_PullACMData(WINMM_Device *device)
MMRESULT mr; MMRESULT mr;
if(device->acm_hdr.cbDstLength == 0){ if(device->acm_hdr.cbDstLength == 0){
hr = IAudioClient_GetCurrentPadding(device->client, &packet);
if(FAILED(hr)){
ERR("GetCurrentPadding failed: %08x\n", hr);
return;
}
if(packet == 0)
return;
hr = IAudioCaptureClient_GetBuffer(device->capture, &data, &packet, hr = IAudioCaptureClient_GetBuffer(device->capture, &data, &packet,
&flags, NULL, NULL); &flags, NULL, NULL);
if(FAILED(hr)){ if(hr != S_OK){
ERR("GetBuffer failed: %08x\n", hr); if(FAILED(hr))
ERR("GetBuffer failed: %08x\n", hr);
return; return;
} }
...@@ -1566,26 +1558,20 @@ static void WID_PullData(WINMM_Device *device) ...@@ -1566,26 +1558,20 @@ static void WID_PullData(WINMM_Device *device)
while(device->first){ while(device->first){
BYTE *data; BYTE *data;
UINT32 pad, packet_len, packet; UINT32 packet_len, packet;
DWORD flags; DWORD flags;
hr = IAudioClient_GetCurrentPadding(device->client, &pad); hr = IAudioCaptureClient_GetBuffer(device->capture, &data, &packet_len,
if(FAILED(hr)){
ERR("GetCurrentPadding failed: %08x\n", hr);
goto exit;
}
if(pad == 0)
goto exit;
hr = IAudioCaptureClient_GetBuffer(device->capture, &data, &packet,
&flags, NULL, NULL); &flags, NULL, NULL);
if(FAILED(hr)){ if(hr != S_OK){
ERR("GetBuffer failed: %08x\n", hr); if(FAILED(hr))
ERR("GetBuffer failed: %08x\n", hr);
else /* AUDCLNT_S_BUFFER_EMPTY success code */
IAudioCaptureClient_ReleaseBuffer(device->capture, 0);
goto exit; goto exit;
} }
packet_len = packet; packet = packet_len;
queue = device->first; queue = device->first;
while(queue && packet > 0){ while(queue && packet > 0){
UINT32 to_copy_bytes; UINT32 to_copy_bytes;
...@@ -1612,6 +1598,8 @@ static void WID_PullData(WINMM_Device *device) ...@@ -1612,6 +1598,8 @@ static void WID_PullData(WINMM_Device *device)
if(FAILED(hr)) if(FAILED(hr))
ERR("ReleaseBuffer failed: %08x\n", hr); ERR("ReleaseBuffer failed: %08x\n", hr);
if(packet > 0)
WARN("losing %u frames\n", packet);
device->played_frames += packet_len; device->played_frames += packet_len;
} }
......
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