From: Giovanni Mascellani gmascellani@codeweavers.com
Otherwise it would fail with other upcoming usages of read_packets(). --- dlls/mmdevapi/tests/capture.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c index 633427db8d8..fbe45311f5c 100644 --- a/dlls/mmdevapi/tests/capture.c +++ b/dlls/mmdevapi/tests/capture.c @@ -110,7 +110,6 @@ static void test_uninitialized(IAudioClient *ac) struct read_packets_data { UINT64 expected_dev_pos; - UINT32 period; BOOL discontinuity_at_0; BOOL discontinuity_at_later; }; @@ -250,13 +249,6 @@ static void read_packets(IAudioClient *ac, IAudioCaptureClient *acc, HANDLE hand
winetest_pop_context(); } - - /* Here we should have basically emptied the buffer, but we allow one or two - * packets to arrive concurrently. */ - hr = IAudioClient_GetCurrentPadding(ac, &padding); - ok(hr == S_OK, "GetCurrentPadding returns %08lx\n", hr); - ok(padding <= 2 * data->period, "GetCurrentPadding %u is larger then twice the period%u\n", - padding, data->period); }
static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) @@ -264,7 +256,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) struct read_packets_data packets_data; IAudioCaptureClient *acc; HRESULT hr; - UINT32 frames, next, pad, sum = 0, buffer_size; + UINT32 frames, next, pad, sum = 0, buffer_size, padding; BYTE *data; DWORD flags; UINT64 pos, qpc; @@ -309,12 +301,12 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
hr = IAudioClient_GetDevicePeriod(ac, &period, NULL); ok(hr == S_OK, "GetDevicePeriod failed: %08lx\n", hr); - packets_data.period = MulDiv(period, wfx->nSamplesPerSec, 10000000); /* as in render.c */ + period = MulDiv(period, wfx->nSamplesPerSec, 10000000); /* as in render.c */
/* GetBufferSize is not a multiple of the period size! */ hr = IAudioClient_GetBufferSize(ac, &buffer_size); ok(hr == S_OK, "GetBufferSize failed: %08lx\n", hr); - trace("GetBufferSize %u period size %u\n", buffer_size, packets_data.period); + trace("GetBufferSize %u period size %llu\n", buffer_size, period);
hr = IAudioClient_Start(ac); ok(hr == S_OK, "Start on a stopped stream returns %08lx\n", hr); @@ -325,6 +317,13 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
read_packets(ac, acc, handle, 10, &packets_data);
+ /* Here we should have basically emptied the buffer, but we allow one or two + * packets to arrive concurrently. */ + hr = IAudioClient_GetCurrentPadding(ac, &padding); + ok(hr == S_OK, "GetCurrentPadding returns %08lx\n", hr); + ok(padding <= 2 * period, "GetCurrentPadding %u is larger then twice the period %llu\n", + padding, period); + todo_wine ok(packets_data.discontinuity_at_0, "No discontinuity at first packet\n"); ok(!packets_data.discontinuity_at_later, "Discontinuity at later packet\n"); @@ -337,6 +336,11 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
read_packets(ac, acc, handle, 10, &packets_data);
+ hr = IAudioClient_GetCurrentPadding(ac, &padding); + ok(hr == S_OK, "GetCurrentPadding returns %08lx\n", hr); + ok(padding <= 2 * period, "GetCurrentPadding %u is larger then twice the period %llu\n", + padding, period); + ok(!packets_data.discontinuity_at_0, "Discontinuity at first packet\n"); ok(!packets_data.discontinuity_at_later, "Discontinuity at later packet\n");