From c192041204436ebab5f3b20542f225920fa1de5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Fri, 3 Jun 2011 19:48:57 +0200 Subject: [PATCH] mmdevapi/tests: Fix wrong buffer unit and memory leaks. --- dlls/mmdevapi/tests/render.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index c0507fe0664..b0d0c6ce587 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -371,6 +371,8 @@ static void test_references(void) 0, pwfx, NULL); ok(hr == S_OK, "Initialize failed: %08x\n", hr); + CoTaskMemFree(pwfx); + hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv); ok(hr == S_OK, "GetService failed: %08x\n", hr); @@ -467,7 +469,7 @@ static void test_padding(void) hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&arc); ok(hr == S_OK, "GetService failed: %08x\n", hr); - psize = (defp / 10000000.) * pwfx->nSamplesPerSec * pwfx->nBlockAlign; + psize = (defp / 10000000.) * pwfx->nSamplesPerSec * 10; written = 0; hr = IAudioClient_GetCurrentPadding(ac, &pad); @@ -487,7 +489,7 @@ static void test_padding(void) ok(hr == S_OK, "GetCurrentPadding failed: %08x\n", hr); ok(pad == written, "GetCurrentPadding returned %u, should be %u\n", pad, written); - psize = (minp / 10000000.) * pwfx->nSamplesPerSec * pwfx->nBlockAlign; + psize = (minp / 10000000.) * pwfx->nSamplesPerSec * 10; hr = IAudioRenderClient_GetBuffer(arc, psize, &buf); ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); @@ -645,6 +647,8 @@ static void test_clock(void) ok(hr == S_OK, "GetPosition failed: %08x\n", hr); ok(pos >= last, "Position should have been further along...\n"); + CoTaskMemFree(pwfx); + IAudioClock_Release(acl); IAudioClient_Release(ac); }