From: Anton Baskanov baskanov@gmail.com
Fixes the following issues: - AddMediaStream with AMMSF_ADDDEFAULTRENDERER fails if there is no sound card. - GetSurface actually returns a non-NULL surface as CreateSample creates the surface if it was not provided. - CreateSample with the pdds7 surface fails with DDERR_INVALIDSURFACETYPE as the surface size does not match the video size.
Signed-off-by: Anton Baskanov baskanov@gmail.com Signed-off-by: Zebediah Figura z.figura12@gmail.com --- v3: Rebase.
dlls/amstream/tests/amstream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index c47f11f1f6c..f6d4c5d3c41 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -296,7 +296,7 @@ static void test_renderfile(void) ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr);
hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, AMMSF_ADDDEFAULTRENDERER, NULL); - ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr); + ok(hr == S_OK || hr == VFW_E_NO_AUDIO_HARDWARE, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_OpenFile(pams, L"test.avi", 0); ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr); @@ -315,14 +315,15 @@ static void test_renderfile(void) surface = NULL; hr = IDirectDrawStreamSample_GetSurface(pddsample, &surface, &rect); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(surface == NULL, "got %p\n", surface); + ok(surface != NULL, "Expected non-NULL surface.\n"); + IDirectDrawSurface_Release(surface); IDirectDrawStreamSample_Release(pddsample);
hr = IDirectDrawSurface7_QueryInterface(pdds7, &IID_IDirectDrawSurface, (void**)&surface); ok(hr == S_OK, "got 0x%08x\n", hr);
EXPECT_REF(surface, 1); - hr = IDirectDrawMediaStream_CreateSample(pddstream, surface, NULL, 0, &pddsample); + hr = IDirectDrawMediaStream_CreateSample(pddstream, surface, &rect, 0, &pddsample); ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr); EXPECT_REF(surface, 2); IDirectDrawStreamSample_Release(pddsample);