From: Derek Lesho dlesho@codeweavers.com
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 33b17b8df41..6da2431a035 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -720,9 +720,19 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected return ret; }
+static const IMFByteStreamVtbl *bytestream_vtbl_orig; + +static int bytestream_closed = 0; +static HRESULT bytestream_wrapper_Close(IMFByteStream *iface) +{ + bytestream_closed = 1; + return bytestream_vtbl_orig->Close(iface); +} + static void test_source_resolver(void) { struct test_callback *callback, *callback2; + IMFByteStreamVtbl bytestream_vtbl_wrapper; IMFSourceResolver *resolver, *resolver2; IMFPresentationDescriptor *descriptor; IMFSchemeHandler *scheme_handler; @@ -826,6 +836,12 @@ static void test_source_resolver(void) hr = MFCreateFile(MF_ACCESSMODE_READ, MF_OPENMODE_FAIL_IF_NOT_EXIST, MF_FILEFLAGS_NONE, filename, &stream); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ /* Wrap ::Close to test when the media source calls it */ + bytestream_vtbl_orig = stream->lpVtbl; + bytestream_vtbl_wrapper = *bytestream_vtbl_orig; + bytestream_vtbl_wrapper.Close = bytestream_wrapper_Close; + stream->lpVtbl = &bytestream_vtbl_wrapper; + hr = IMFByteStream_QueryInterface(stream, &IID_IMFAttributes, (void **)&attributes); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFAttributes_SetString(attributes, &MF_BYTESTREAM_CONTENT_TYPE, L"video/mp4"); @@ -1059,9 +1075,14 @@ static void test_source_resolver(void) IMFMediaTypeHandler_Release(handler); IMFPresentationDescriptor_Release(descriptor);
+ ok(!bytestream_closed, "IMFByteStream::Close called unexpectedly\n"); + hr = IMFMediaSource_Shutdown(mediasource); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ todo_wine + ok(bytestream_closed, "Missing IMFByteStream::Close call\n"); + hr = IMFMediaSource_CreatePresentationDescriptor(mediasource, NULL); ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
From: Derek Lesho dlesho@codeweavers.com
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 1 - dlls/winegstreamer/media_source.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 6da2431a035..d967ff62c01 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -1080,7 +1080,6 @@ static void test_source_resolver(void) hr = IMFMediaSource_Shutdown(mediasource); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
- todo_wine ok(bytestream_closed, "Missing IMFByteStream::Close call\n");
hr = IMFMediaSource_CreatePresentationDescriptor(mediasource, NULL); diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 542189b28f5..1b57d8bfba8 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -1344,6 +1344,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface)
IMFPresentationDescriptor_Release(source->pres_desc); IMFMediaEventQueue_Shutdown(source->event_queue); + IMFByteStream_Close(source->byte_stream); IMFByteStream_Release(source->byte_stream);
for (i = 0; i < source->stream_count; i++)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=130347
Your paranoid android.
=== w8 (32 bit report) ===
mfplat: 0cb0:mfplat: unhandled exception c0000005 at 6AE3EE4F
=== w8adm (32 bit report) ===
mfplat: 09f8:mfplat: unhandled exception c0000005 at 6882EE4F
=== w864 (32 bit report) ===
mfplat: 05ac:mfplat: unhandled exception c0000005 at 732C1B51
=== w1064v1507 (32 bit report) ===
mfplat: 0c90:mfplat: unhandled exception c0000005 at 73BA6231
=== w1064v1809 (32 bit report) ===
mfplat: 1778:mfplat: unhandled exception c0000005 at 739894AC
=== w10pro64 (32 bit report) ===
mfplat: 1e94:mfplat: unhandled exception c0000005 at 73ADD7D8
=== w11pro64 (32 bit report) ===
mfplat: 1f48:mfplat: unhandled exception c0000005 at 72EC88D4
This fixes a bug in Wo Long which uses its own byte pool implementation. The pool size is limited to 64, and when ::Close isn't called the pool fills up causing any following videos to not play correctly.