Instead of https://gitlab.winehq.org/wine/wine/-/merge_requests/1311, which will need to be updated according to pass the new tests.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/Makefile.in | 1 - dlls/winegstreamer/gst_private.h | 2 -- dlls/winegstreamer/winegstreamer.spec | 1 - dlls/wmvcore/Makefile.in | 1 + .../async_reader.c} | 31 +++++++++++++++++-- dlls/wmvcore/wmvcore_main.c | 27 +++++----------- dlls/wmvcore/{wmvcore.h => wmvcore_private.h} | 30 ++++++++++++++++-- dlls/wmvcore/writer.c | 2 +- 8 files changed, 66 insertions(+), 29 deletions(-) rename dlls/{winegstreamer/wm_asyncreader.c => wmvcore/async_reader.c} (99%) rename dlls/wmvcore/{wmvcore.h => wmvcore_private.h} (57%)
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 3daa929b36d..064a8b68343 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -22,7 +22,6 @@ C_SRCS = \ wg_parser.c \ wg_sample.c \ wg_transform.c \ - wm_asyncreader.c \ wm_reader.c \ wma_decoder.c \ wmv_decoder.c diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 523e2711edb..ee5e6dae3cf 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -147,6 +147,4 @@ HRESULT aac_decoder_create(REFIID riid, void **ret); HRESULT h264_decoder_create(REFIID riid, void **ret); HRESULT video_processor_create(REFIID riid, void **ret);
-HRESULT WINAPI winegstreamer_create_wm_sync_reader(IUnknown *outer, void **out); - #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/winegstreamer.spec b/dlls/winegstreamer/winegstreamer.spec index 911689210b7..9804e324044 100644 --- a/dlls/winegstreamer/winegstreamer.spec +++ b/dlls/winegstreamer/winegstreamer.spec @@ -2,5 +2,4 @@ @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() -@ stdcall winegstreamer_create_wm_async_reader(ptr) @ stdcall winegstreamer_create_wm_sync_reader(ptr ptr) diff --git a/dlls/wmvcore/Makefile.in b/dlls/wmvcore/Makefile.in index 6aed828abae..6f4f01bec40 100644 --- a/dlls/wmvcore/Makefile.in +++ b/dlls/wmvcore/Makefile.in @@ -7,6 +7,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native
C_SRCS = \ wmvcore_main.c \ + async_reader.c \ writer.c
RC_SRCS = version.rc diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/wmvcore/async_reader.c similarity index 99% rename from dlls/winegstreamer/wm_asyncreader.c rename to dlls/wmvcore/async_reader.c index 409ebeae1af..a51018260b1 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/wmvcore/async_reader.c @@ -16,8 +16,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "gst_private.h" +#include <stdarg.h> +#include <stddef.h> +#include <stdbool.h>
+#define COBJMACROS +#include "windef.h" +#include "winbase.h" + +#define EXTERN_GUID DEFINE_GUID +#include "initguid.h" +#include "wmvcore_private.h" + +#include "wmsdk.h" + +#include "wine/debug.h" #include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); @@ -1881,7 +1894,7 @@ static const IReferenceClockVtbl ReferenceClockVtbl = refclock_Unadvise };
-HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) +static HRESULT WINAPI async_reader_create(IWMReader **reader) { struct async_reader *object; HRESULT hr; @@ -1927,3 +1940,17 @@ failed: free(object); return hr; } + +HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **reader) +{ + TRACE("reserved %p, rights %#lx, reader %p.\n", reserved, rights, reader); + + return async_reader_create(reader); +} + +HRESULT WINAPI WMCreateReaderPriv(IWMReader **reader) +{ + TRACE("reader %p.\n", reader); + + return async_reader_create(reader); +} diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index bae37cd1cff..016287b1b78 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -16,32 +16,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "wmvcore.h" +#include <stdarg.h> +#include <stddef.h>
-#include "initguid.h" +#define COBJMACROS +#include "windef.h" +#include "winbase.h" + +#include "wmvcore_private.h" #include "wmsdk.h" + #include "wine/debug.h" #include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
-HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader); -HRESULT WINAPI winegstreamer_create_wm_sync_reader(IUnknown *outer, void **out); - -HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **reader) -{ - TRACE("reserved %p, rights %#lx, reader %p.\n", reserved, rights, reader); - - return winegstreamer_create_wm_async_reader(reader); -} - -HRESULT WINAPI WMCreateReaderPriv(IWMReader **reader) -{ - TRACE("reader %p.\n", reader); - - return winegstreamer_create_wm_async_reader(reader); -} - HRESULT WINAPI WMCreateSyncReader(IUnknown *reserved, DWORD rights, IWMSyncReader **reader) { TRACE("reserved %p, rights %#lx, reader %p.\n", reserved, rights, reader); diff --git a/dlls/wmvcore/wmvcore.h b/dlls/wmvcore/wmvcore_private.h similarity index 57% rename from dlls/wmvcore/wmvcore.h rename to dlls/wmvcore/wmvcore_private.h index e17547052de..a5225d79da9 100644 --- a/dlls/wmvcore/wmvcore.h +++ b/dlls/wmvcore/wmvcore_private.h @@ -17,10 +17,34 @@ */
#include <stdarg.h> +#include <stddef.h>
#define COBJMACROS - -#define EXTERN_GUID DEFINE_GUID - #include "windef.h" #include "winbase.h" +#include "objidl.h" + +#include "wine/debug.h" + +HRESULT WINAPI winegstreamer_create_wm_sync_reader(IUnknown *outer, void **out); + +static inline const char *debugstr_time(LONGLONG time) +{ + ULONGLONG abstime = time >= 0 ? time : -time; + unsigned int i = 0, j = 0; + char buffer[23], rev[23]; + + while (abstime || i <= 8) + { + buffer[i++] = '0' + (abstime % 10); + abstime /= 10; + if (i == 7) buffer[i++] = '.'; + } + if (time < 0) buffer[i++] = '-'; + + while (i--) rev[j++] = buffer[i]; + while (rev[j-1] == '0' && rev[j-2] != '.') --j; + rev[j] = 0; + + return wine_dbg_sprintf("%s", rev); +} diff --git a/dlls/wmvcore/writer.c b/dlls/wmvcore/writer.c index 5c62cd35143..f34e40f0e47 100644 --- a/dlls/wmvcore/writer.c +++ b/dlls/wmvcore/writer.c @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "wmvcore.h" +#include "wmvcore_private.h" #include "wmsdkidl.h"
#include "wine/debug.h"
From: Rémi Bernon rbernon@codeweavers.com
And that it also allocates the samples. --- dlls/wmvcore/tests/wmvcore.c | 66 ++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 7 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 874fca81367..f3d30772282 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -451,6 +451,8 @@ struct teststream IStream IStream_iface; LONG refcount; HANDLE file; + DWORD input_tid; + DWORD main_tid; };
static struct teststream *impl_from_IStream(IStream *iface) @@ -490,6 +492,14 @@ static HRESULT WINAPI stream_Read(IStream *iface, void *data, ULONG size, ULONG if (winetest_debug > 2) trace("%04lx: IStream::Read(size %lu)\n", GetCurrentThreadId(), size);
+ if (!stream->input_tid) + stream->input_tid = GetCurrentThreadId(); + else + { + todo_wine_if(stream->input_tid == stream->main_tid) + ok(stream->input_tid == GetCurrentThreadId(), "got wrong thread\n"); + } + ok(size > 0, "Got zero size.\n"); ok(!!ret_size, "Got NULL ret_size pointer.\n"); if (!ReadFile(stream->file, data, size, ret_size, NULL)) @@ -511,6 +521,14 @@ static HRESULT WINAPI stream_Seek(IStream *iface, LARGE_INTEGER offset, DWORD me if (winetest_debug > 2) trace("%04lx: IStream::Seek(offset %I64u, method %#lx)\n", GetCurrentThreadId(), offset.QuadPart, method);
+ if (!stream->input_tid) + stream->input_tid = GetCurrentThreadId(); + else + { + todo_wine_if(stream->input_tid == stream->main_tid) + ok(stream->input_tid == GetCurrentThreadId(), "got wrong thread\n"); + } + GetFileSizeEx(stream->file, &size); ok(offset.QuadPart < size.QuadPart, "Expected offset less than size %I64u, got %I64u.\n", size.QuadPart, offset.QuadPart); @@ -568,6 +586,14 @@ static HRESULT WINAPI stream_Stat(IStream *iface, STATSTG *stat, DWORD flags) if (winetest_debug > 1) trace("%04lx: IStream::Stat(flags %#lx)\n", GetCurrentThreadId(), flags);
+ if (!stream->input_tid) + stream->input_tid = GetCurrentThreadId(); + else + { + todo_wine_if(stream->input_tid == stream->main_tid) + ok(stream->input_tid == GetCurrentThreadId(), "got wrong thread\n"); + } + ok(flags == STATFLAG_NONAME, "Got flags %#lx.\n", flags);
stat->type = 0xdeadbeef; @@ -609,6 +635,7 @@ static void teststream_init(struct teststream *stream, HANDLE file) stream->IStream_iface.lpVtbl = &stream_vtbl; stream->refcount = 1; stream->file = file; + stream->main_tid = GetCurrentThreadId(); }
static void test_reader_attributes(IWMProfile *profile) @@ -1375,6 +1402,7 @@ static void test_sync_reader_streaming(void)
ok(stream.refcount == 1, "Got outstanding refcount %ld.\n", stream.refcount);
+ stream.input_tid = 0; /* FIXME: currently required as Wine calls IStream_Stat synchronously in OpenStream */ SetFilePointer(stream.file, 0, NULL, FILE_BEGIN); hr = IWMSyncReader_OpenStream(reader, &stream.IStream_iface); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -1803,6 +1831,7 @@ struct callback bool dedicated_threads; DWORD callback_tid; DWORD output_tid[2]; + struct teststream *stream;
QWORD last_pts;
@@ -1995,6 +2024,7 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output, QWORD time, QWORD duration, DWORD flags, INSSBuffer *sample, void *context) { struct callback *callback = impl_from_IWMReaderCallback(iface); + struct teststream *stream = callback->stream;
if (winetest_debug > 1) trace("%lu: %04lx: IWMReaderCallback::OnSample(output %lu, time %I64u, duration %I64u, flags %#lx)\n", @@ -2019,6 +2049,9 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output, ok(callback->output_tid[1 - output] != GetCurrentThreadId(), "got wrong thread\n"); }
+ if (stream) + ok(stream->input_tid != GetCurrentThreadId(), "got wrong thread\n"); + ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context);
check_async_sample(callback, sample); @@ -2067,6 +2100,7 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced WORD stream_number, QWORD pts, QWORD duration, DWORD flags, INSSBuffer *sample, void *context) { struct callback *callback = impl_from_IWMReaderCallbackAdvanced(iface); + struct teststream *stream = callback->stream;
if (winetest_debug > 1) trace("%lu: %04lx: IWMReaderCallbackAdvanced::OnStreamSample(stream %u, pts %I64u, duration %I64u, flags %#lx)\n", @@ -2095,6 +2129,9 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced ok(callback->output_tid[2 - stream_number] != GetCurrentThreadId(), "got wrong thread\n"); }
+ if (stream) + ok(stream->input_tid != GetCurrentThreadId(), "got wrong thread\n"); + ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context);
check_async_sample(callback, sample); @@ -2142,6 +2179,7 @@ static HRESULT WINAPI callback_advanced_AllocateForStream(IWMReaderCallbackAdvan { struct callback *callback = impl_from_IWMReaderCallbackAdvanced(iface); DWORD max_size = callback->max_stream_sample_size[stream_number - 1]; + struct teststream *stream = callback->stream; struct buffer *object;
if (winetest_debug > 1) @@ -2152,6 +2190,11 @@ static HRESULT WINAPI callback_advanced_AllocateForStream(IWMReaderCallbackAdvan ok(callback->callback_tid != GetCurrentThreadId(), "got wrong thread\n"); todo_wine_if(callback->output_tid[stream_number - 1]) ok(callback->output_tid[stream_number - 1] != GetCurrentThreadId(), "got wrong thread\n"); + if (stream) + { + todo_wine + ok(stream->input_tid == GetCurrentThreadId(), "got wrong thread\n"); + }
ok(callback->read_compressed, "AllocateForStream() should only be called when reading compressed samples.\n"); ok(callback->allocated_samples, "AllocateForStream() should only be called when using a custom allocator.\n"); @@ -2180,6 +2223,7 @@ static HRESULT WINAPI callback_advanced_AllocateForOutput(IWMReaderCallbackAdvan DWORD output, DWORD size, INSSBuffer **sample, void *context) { struct callback *callback = impl_from_IWMReaderCallbackAdvanced(iface); + struct teststream *stream = callback->stream; struct buffer *object;
if (winetest_debug > 1) @@ -2190,6 +2234,11 @@ static HRESULT WINAPI callback_advanced_AllocateForOutput(IWMReaderCallbackAdvan ok(callback->callback_tid != GetCurrentThreadId(), "got wrong thread\n"); todo_wine_if(callback->output_tid[output]) ok(callback->output_tid[output] != GetCurrentThreadId(), "got wrong thread\n"); + if (stream) + { + todo_wine + ok(stream->input_tid == GetCurrentThreadId(), "got wrong thread\n"); + }
if (!callback->read_compressed) { @@ -2314,7 +2363,7 @@ static const IWMReaderAllocatorExVtbl callback_allocator_vtbl = callback_allocator_AllocateForOutputEx, };
-static void callback_init(struct callback *callback) +static void callback_init(struct callback *callback, struct teststream *stream) { memset(callback, 0, sizeof(*callback)); callback->IWMReaderCallback_iface.lpVtbl = &callback_vtbl; @@ -2330,6 +2379,7 @@ static void callback_init(struct callback *callback) callback->expect_eof = CreateEventW(NULL, FALSE, FALSE, NULL); callback->got_eof = CreateEventW(NULL, FALSE, FALSE, NULL); callback->ontime_event = CreateEventW(NULL, FALSE, FALSE, NULL); + callback->stream = stream; }
static void callback_cleanup(struct callback *callback) @@ -2466,6 +2516,8 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st callback->callback_tid = 0; callback->last_pts = 0; memset(callback->output_tid, 0, sizeof(callback->output_tid)); + if (callback->stream) + callback->stream->input_tid = 0;
check_async_set_output_setting(advanced, 0, L"DedicatedDeliveryThread", WMT_TYPE_BOOL, callback->dedicated_threads, S_OK); @@ -2764,7 +2816,7 @@ static void test_async_reader_settings(void) WORD size; BOOL ret;
- callback_init(&callback); + callback_init(&callback, NULL);
hr = WMCreateReader(NULL, 0, &reader); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2949,7 +3001,7 @@ static void test_async_reader_streaming(void) ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %lu.\n", debugstr_w(file), GetLastError());
teststream_init(&stream, file); - callback_init(&callback); + callback_init(&callback, &stream);
hr = WMCreateReader(NULL, 0, &reader); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2967,6 +3019,7 @@ static void test_async_reader_streaming(void) ok(callback.refcount > 1, "Got refcount %ld.\n", callback.refcount); wait_opened_callback(&callback);
+ stream.input_tid = 0; /* FIXME: currently required as Wine calls IStream_Stat synchronously in OpenStream */ hr = IWMReaderAdvanced2_OpenStream(advanced, &stream.IStream_iface, &callback.IWMReaderCallback_iface, (void **)0xdeadbee0); ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr);
@@ -3110,7 +3163,7 @@ static void test_async_reader_types(void) ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %lu.\n", debugstr_w(file), GetLastError());
teststream_init(&stream, file); - callback_init(&callback); + callback_init(&callback, &stream);
hr = WMCreateReader(NULL, 0, &reader); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3402,7 +3455,7 @@ static void test_async_reader_file(void) ULONG ref; BOOL ret;
- callback_init(&callback); + callback_init(&callback, NULL);
hr = WMCreateReader(NULL, 0, &reader); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3461,8 +3514,6 @@ static void test_sync_reader_allocator(void) HRESULT hr; BOOL ret;
- callback_init(&callback); - hr = WMCreateSyncReader(NULL, 0, (IWMSyncReader **)&reader); ok(hr == S_OK, "Got hr %#lx.\n", hr);
@@ -3470,6 +3521,7 @@ static void test_sync_reader_allocator(void) ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %lu.\n", debugstr_w(file), GetLastError());
teststream_init(&stream, file); + callback_init(&callback, &stream);
hr = IWMSyncReader2_OpenStream(reader, &stream.IStream_iface); ok(hr == S_OK, "Got hr %#lx.\n", hr);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wmvcore/tests/wmvcore.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index f3d30772282..f8009735af2 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -2101,6 +2101,7 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced { struct callback *callback = impl_from_IWMReaderCallbackAdvanced(iface); struct teststream *stream = callback->stream; + DWORD output = 2 - stream_number;
if (winetest_debug > 1) trace("%lu: %04lx: IWMReaderCallbackAdvanced::OnStreamSample(stream %u, pts %I64u, duration %I64u, flags %#lx)\n", @@ -2118,15 +2119,15 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced callback->last_pts = pts; }
- if (!callback->output_tid[stream_number - 1]) - callback->output_tid[stream_number - 1] = GetCurrentThreadId(); + if (!callback->output_tid[output]) + callback->output_tid[output] = GetCurrentThreadId(); else - ok(callback->output_tid[stream_number - 1] == GetCurrentThreadId(), "got wrong thread\n"); + ok(callback->output_tid[output] == GetCurrentThreadId(), "got wrong thread\n");
- if (callback->dedicated_threads && callback->output_tid[2 - stream_number]) + if (callback->dedicated_threads && callback->output_tid[1 - output]) { todo_wine - ok(callback->output_tid[2 - stream_number] != GetCurrentThreadId(), "got wrong thread\n"); + ok(callback->output_tid[1 - output] != GetCurrentThreadId(), "got wrong thread\n"); }
if (stream)
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wmvcore/tests/wmvcore.c | 51 ++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index f8009735af2..fe48aad529e 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1834,9 +1834,8 @@ struct callback struct teststream *stream;
QWORD last_pts; - - QWORD expect_ontime; - HANDLE ontime_event; + QWORD expect_time; + HANDLE expect_ontime, got_ontime; };
static struct callback *impl_from_IWMReaderCallback(IWMReaderCallback *iface) @@ -2148,6 +2147,7 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced static HRESULT WINAPI callback_advanced_OnTime(IWMReaderCallbackAdvanced *iface, QWORD time, void *context) { struct callback *callback = impl_from_IWMReaderCallbackAdvanced(iface); + DWORD ret;
if (winetest_debug > 1) trace("%lu: %04lx: IWMReaderCallbackAdvanced::OnTime(time %I64u)\n", @@ -2155,9 +2155,11 @@ static HRESULT WINAPI callback_advanced_OnTime(IWMReaderCallbackAdvanced *iface,
ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n");
- ok(time == callback->expect_ontime, "Got time %I64u.\n", time); + ok(time == callback->expect_time, "Got time %I64u.\n", time); ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); - SetEvent(callback->ontime_event); + ret = WaitForSingleObject(callback->expect_ontime, 100); + ok(!ret, "Wait timed out.\n"); + SetEvent(callback->got_ontime); return S_OK; }
@@ -2379,7 +2381,8 @@ static void callback_init(struct callback *callback, struct teststream *stream) callback->got_stopped = CreateEventW(NULL, FALSE, FALSE, NULL); callback->expect_eof = CreateEventW(NULL, FALSE, FALSE, NULL); callback->got_eof = CreateEventW(NULL, FALSE, FALSE, NULL); - callback->ontime_event = CreateEventW(NULL, FALSE, FALSE, NULL); + callback->expect_ontime = CreateEventW(NULL, FALSE, FALSE, NULL); + callback->got_ontime = CreateEventW(NULL, FALSE, FALSE, NULL); callback->stream = stream; }
@@ -2393,7 +2396,8 @@ static void callback_cleanup(struct callback *callback) CloseHandle(callback->expect_stopped); CloseHandle(callback->got_eof); CloseHandle(callback->expect_eof); - CloseHandle(callback->ontime_event); + CloseHandle(callback->got_ontime); + CloseHandle(callback->expect_ontime); }
#define wait_opened_callback(a) wait_opened_callback_(__LINE__, a) @@ -2445,6 +2449,18 @@ static void wait_eof_callback_(int line, struct callback *callback) ok_(__FILE__, line)(callback->eof_count == 1, "Got %u WMT_EOF callbacks.\n", callback->eof_count); }
+#define wait_ontime_callback(a) wait_ontime_callback_(__LINE__, a) +static void wait_ontime_callback_(int line, struct callback *callback) +{ + DWORD ret; + + ret = WaitForSingleObject(callback->got_ontime, 0); + ok_(__FILE__, line)(ret == WAIT_TIMEOUT, "Got unexpected OnTime.\n"); + SetEvent(callback->expect_ontime); + ret = WaitForSingleObject(callback->got_ontime, 1000); + ok_(__FILE__, line)(!ret, "Wait timed out.\n"); +} + static void check_async_get_output_setting(IWMReaderAdvanced2 *reader, DWORD output, const WCHAR *name, WMT_ATTR_DATATYPE expect_type, DWORD expect_value, HRESULT expect_hr) { @@ -2546,8 +2562,8 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_DeliverTime(advanced, test_wmv_duration * 2); ok(hr == S_OK, "Got hr %#lx.\n", hr); - wait_eof_callback(callback); + wait_ontime_callback(callback);
hr = IWMReader_Stop(reader); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3054,24 +3070,19 @@ static void test_async_reader_streaming(void) ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_SetUserProvidedClock(advanced, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr); - callback.expect_ontime = 0; + callback.expect_time = 0; hr = IWMReaderAdvanced2_DeliverTime(advanced, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); - ret = WaitForSingleObject(callback.ontime_event, 1000); - ok(!ret, "Wait timed out.\n"); - callback.expect_ontime = test_wmv_duration / 2; + wait_ontime_callback(&callback); + callback.expect_time = test_wmv_duration / 2; hr = IWMReaderAdvanced2_DeliverTime(advanced, test_wmv_duration / 2); ok(hr == S_OK, "Got hr %#lx.\n", hr); - ret = WaitForSingleObject(callback.ontime_event, 1000); - ok(!ret, "Wait timed out.\n"); - callback.expect_ontime = test_wmv_duration * 2; + wait_ontime_callback(&callback); + callback.expect_time = test_wmv_duration * 2; hr = IWMReaderAdvanced2_DeliverTime(advanced, test_wmv_duration * 2); ok(hr == S_OK, "Got hr %#lx.\n", hr); - wait_eof_callback(&callback); - - ret = WaitForSingleObject(callback.ontime_event, 1000); - ok(!ret, "Wait timed out.\n"); + wait_ontime_callback(&callback);
hr = IWMReader_Start(reader, 0, 0, 1.0f, (void *)NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3079,8 +3090,8 @@ static void test_async_reader_streaming(void)
hr = IWMReaderAdvanced2_DeliverTime(advanced, test_wmv_duration * 2); ok(hr == S_OK, "Got hr %#lx.\n", hr); - wait_eof_callback(&callback); + wait_ontime_callback(&callback);
hr = IWMReader_Stop(reader); ok(hr == S_OK, "Got hr %#lx.\n", hr);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wmvcore/tests/wmvcore.c | 62 +++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index fe48aad529e..a4acf2b68a5 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1833,7 +1833,8 @@ struct callback DWORD output_tid[2]; struct teststream *stream;
- QWORD last_pts; + QWORD last_pts[2]; + QWORD next_pts[2]; QWORD expect_time; HANDLE expect_ontime, got_ontime; }; @@ -2029,6 +2030,11 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output, trace("%lu: %04lx: IWMReaderCallback::OnSample(output %lu, time %I64u, duration %I64u, flags %#lx)\n", GetTickCount(), GetCurrentThreadId(), output, time, duration, flags);
+ /* uncompressed samples are slightly out of order because of decoding delay */ + ok(callback->last_pts[output] <= time, "got time %I64d\n", time); + callback->last_pts[output] = time; + callback->next_pts[output] = time + duration; + if (callback->dedicated_threads) { todo_wine @@ -2106,6 +2112,10 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced trace("%lu: %04lx: IWMReaderCallbackAdvanced::OnStreamSample(stream %u, pts %I64u, duration %I64u, flags %#lx)\n", GetTickCount(), GetCurrentThreadId(), stream_number, pts, duration, flags);
+ ok(callback->last_pts[output] <= pts, "got pts %I64d\n", pts); + callback->last_pts[output] = pts; + callback->next_pts[output] = pts + duration; + if (callback->dedicated_threads) { todo_wine @@ -2114,8 +2124,7 @@ static HRESULT WINAPI callback_advanced_OnStreamSample(IWMReaderCallbackAdvanced else { ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n"); - ok(callback->last_pts <= pts, "got pts %I64d\n", pts); - callback->last_pts = pts; + ok(callback->last_pts[1 - output] <= pts, "got pts %I64d\n", pts); }
if (!callback->output_tid[output]) @@ -2531,7 +2540,10 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st callback->end_of_streaming_count = 0; callback->eof_count = 0; callback->callback_tid = 0; - callback->last_pts = 0; + callback->last_pts[0] = 0; + callback->next_pts[0] = 0; + callback->last_pts[1] = 0; + callback->next_pts[1] = 0; memset(callback->output_tid, 0, sizeof(callback->output_tid)); if (callback->stream) callback->stream->input_tid = 0; @@ -2564,6 +2576,24 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st ok(hr == S_OK, "Got hr %#lx.\n", hr); wait_eof_callback(callback); wait_ontime_callback(callback); + if (callback->last_pts[0]) + { + todo_wine + ok(callback->last_pts[0] == 19960000, "Got pts %I64d.\n", callback->last_pts[0]); + todo_wine + ok(callback->next_pts[0] == 20420000, "Got pts %I64d.\n", callback->next_pts[0]); + } + if (callback->last_pts[1]) + { + todo_wine_if(!callback->read_compressed) + ok(callback->last_pts[1] == 20060000, "Got pts %I64d.\n", callback->last_pts[1]); + todo_wine + ok(callback->next_pts[1] == 20070000, "Got pts %I64d.\n", callback->next_pts[1]); + } + callback->last_pts[0] = 0; + callback->next_pts[0] = 0; + callback->last_pts[1] = 0; + callback->next_pts[1] = 0;
hr = IWMReader_Stop(reader); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3083,6 +3113,18 @@ static void test_async_reader_streaming(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); wait_eof_callback(&callback); wait_ontime_callback(&callback); + todo_wine + ok(callback.last_pts[0] == 19960000, "Got pts %I64d.\n", callback.last_pts[0]); + todo_wine + ok(callback.next_pts[0] == 20420000, "Got pts %I64d.\n", callback.next_pts[0]); + todo_wine + ok(callback.last_pts[1] == 20060000, "Got pts %I64d.\n", callback.last_pts[1]); + todo_wine + ok(callback.next_pts[1] == 20070000, "Got pts %I64d.\n", callback.next_pts[1]); + callback.last_pts[0] = 0; + callback.next_pts[0] = 0; + callback.last_pts[1] = 0; + callback.next_pts[1] = 0;
hr = IWMReader_Start(reader, 0, 0, 1.0f, (void *)NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3092,6 +3134,18 @@ static void test_async_reader_streaming(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); wait_eof_callback(&callback); wait_ontime_callback(&callback); + todo_wine + ok(callback.last_pts[0] == 19960000, "Got pts %I64d.\n", callback.last_pts[0]); + todo_wine + ok(callback.next_pts[0] == 20420000, "Got pts %I64d.\n", callback.next_pts[0]); + todo_wine + ok(callback.last_pts[1] == 20060000, "Got pts %I64d.\n", callback.last_pts[1]); + todo_wine + ok(callback.next_pts[1] == 20070000, "Got pts %I64d.\n", callback.next_pts[1]); + callback.last_pts[0] = 0; + callback.next_pts[0] = 0; + callback.last_pts[1] = 0; + callback.next_pts[1] = 0;
hr = IWMReader_Stop(reader); ok(hr == S_OK, "Got hr %#lx.\n", hr);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wmvcore/tests/wmvcore.c | 72 ++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index a4acf2b68a5..fa032068a32 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -2164,6 +2164,7 @@ static HRESULT WINAPI callback_advanced_OnTime(IWMReaderCallbackAdvanced *iface,
ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n");
+ todo_wine_if(time % 10000) ok(time == callback->expect_time, "Got time %I64u.\n", time); ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); ret = WaitForSingleObject(callback->expect_ontime, 100); @@ -2458,16 +2459,19 @@ static void wait_eof_callback_(int line, struct callback *callback) ok_(__FILE__, line)(callback->eof_count == 1, "Got %u WMT_EOF callbacks.\n", callback->eof_count); }
-#define wait_ontime_callback(a) wait_ontime_callback_(__LINE__, a) -static void wait_ontime_callback_(int line, struct callback *callback) +#define wait_ontime_callback(a) wait_ontime_callback_(__LINE__, a, FALSE) +static void wait_ontime_callback_(int line, struct callback *callback, BOOL todo) { DWORD ret;
ret = WaitForSingleObject(callback->got_ontime, 0); ok_(__FILE__, line)(ret == WAIT_TIMEOUT, "Got unexpected OnTime.\n"); SetEvent(callback->expect_ontime); - ret = WaitForSingleObject(callback->got_ontime, 1000); + ret = WaitForSingleObject(callback->got_ontime, (todo && !strcmp(winetest_platform, "wine")) ? 100 : 1000); + todo_wine_if(todo) ok_(__FILE__, line)(!ret, "Wait timed out.\n"); + if (todo && ret == WAIT_TIMEOUT) + ResetEvent(callback->expect_ontime); }
static void check_async_get_output_setting(IWMReaderAdvanced2 *reader, DWORD output, const WCHAR *name, @@ -2572,6 +2576,68 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st
hr = IWMReaderAdvanced2_SetUserProvidedClock(advanced, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (!callback->all_streams_off) + { + callback->expect_time = 2780000; + hr = IWMReaderAdvanced2_DeliverTime(advanced, 2770001); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + wait_ontime_callback(callback); + if (callback->last_pts[0]) + { + todo_wine + ok(callback->last_pts[0] == 2780000, "Got pts %I64d.\n", callback->last_pts[0]); + todo_wine + ok(callback->next_pts[0] == 3240000, "Got pts %I64d.\n", callback->next_pts[0]); + } + if (callback->last_pts[1]) + { + todo_wine_if(!callback->read_compressed) + ok(callback->last_pts[1] == 2460000, "Got pts %I64d.\n", callback->last_pts[1]); + todo_wine + ok(callback->next_pts[1] == 2470000, "Got pts %I64d.\n", callback->next_pts[1]); + } + + callback->expect_time = 2850000; + hr = IWMReaderAdvanced2_DeliverTime(advanced, 2849999); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + wait_ontime_callback(callback); + if (callback->last_pts[0]) + { + todo_wine_if(!callback->read_compressed) + ok(callback->last_pts[0] == 2780000, "Got pts %I64d.\n", callback->last_pts[0]); + todo_wine + ok(callback->next_pts[0] == 3240000, "Got pts %I64d.\n", callback->next_pts[0]); + } + if (callback->last_pts[1]) + { + todo_wine_if(!callback->read_compressed) + ok(callback->last_pts[1] == 2460000, "Got pts %I64d.\n", callback->last_pts[1]); + todo_wine + ok(callback->next_pts[1] == 2470000, "Got pts %I64d.\n", callback->next_pts[1]); + } + + callback->expect_time = 2860000; + hr = IWMReaderAdvanced2_DeliverTime(advanced, 2850001); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + wait_ontime_callback_(__LINE__, callback, TRUE); + if (callback->last_pts[0]) + { + todo_wine_if(!callback->read_compressed) + ok(callback->last_pts[0] == 2780000, "Got pts %I64d.\n", callback->last_pts[0]); + todo_wine + ok(callback->next_pts[0] == 3240000, "Got pts %I64d.\n", callback->next_pts[0]); + } + if (callback->last_pts[1]) + { + todo_wine + ok(callback->last_pts[1] == 2860000, "Got pts %I64d.\n", callback->last_pts[1]); + todo_wine + ok(callback->next_pts[1] == 2870000, "Got pts %I64d.\n", callback->next_pts[1]); + } + } + + callback->expect_time = test_wmv_duration * 2; hr = IWMReaderAdvanced2_DeliverTime(advanced, test_wmv_duration * 2); ok(hr == S_OK, "Got hr %#lx.\n", hr); wait_eof_callback(callback);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wmvcore/tests/wmvcore.c | 104 ++++++++++++++++++++++++++++++++--- 1 file changed, 97 insertions(+), 7 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index fa032068a32..2b2dd0b5457 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1823,9 +1823,11 @@ struct callback unsigned int closed_count, started_count, end_of_streaming_count, eof_count, sample_count; bool all_streams_off; bool allocated_samples; + bool allocated_compressed_samples; void *expect_context;
bool read_compressed; + bool todo_compressed; DWORD max_stream_sample_size[2];
bool dedicated_threads; @@ -1985,16 +1987,27 @@ static void check_async_sample(struct callback *callback, INSSBuffer *sample) BYTE *data, *data2; HRESULT hr;
- if (callback->allocated_samples) + if (callback->read_compressed ? callback->allocated_compressed_samples : callback->allocated_samples) { struct buffer *buffer = impl_from_INSSBuffer(sample);
+ /* FIXME: Wine badly synchronize compressed reads and user time, spurious + * samples are possible making todo condition inconsistent. */ + todo_wine_if(callback->todo_compressed && sample->lpVtbl != &buffer_vtbl) ok(sample->lpVtbl == &buffer_vtbl, "Buffer vtbl didn't match.\n"); + if (sample->lpVtbl != &buffer_vtbl) + return; + ok(buffer->size > 0 && buffer->size <= buffer->capacity, "Got size %ld.\n", buffer->size); } else { + /* FIXME: Wine badly synchronize compressed reads and user time, spurious + * samples are possible making todo condition inconsistent. */ + todo_wine_if(callback->todo_compressed && sample->lpVtbl == &buffer_vtbl) ok(sample->lpVtbl != &buffer_vtbl, "Buffer vtbl shouldn't match.\n"); + if (sample->lpVtbl == &buffer_vtbl) + return;
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2210,7 +2223,8 @@ static HRESULT WINAPI callback_advanced_AllocateForStream(IWMReaderCallbackAdvan }
ok(callback->read_compressed, "AllocateForStream() should only be called when reading compressed samples.\n"); - ok(callback->allocated_samples, "AllocateForStream() should only be called when using a custom allocator.\n"); + ok(callback->allocated_compressed_samples, + "AllocateForStream() should only be called when using a custom allocator.\n");
ok(size <= max_size, "Got size %lu, max stream sample size %lu.\n", size, max_size);
@@ -2323,7 +2337,7 @@ static HRESULT WINAPI callback_allocator_AllocateForStreamEx(IWMReaderAllocatorE struct callback *callback = impl_from_IWMReaderAllocatorEx(iface); struct buffer *object;
- ok(callback->allocated_samples, "Unexpected call.\n"); + ok(callback->allocated_compressed_samples, "Unexpected call.\n"); ok(stream_number, "got stream_number %u.\n", stream_number); ok(!flags, "got flags %#lx.\n", flags); ok(!pts, "got pts %I64d.\n", pts); @@ -2637,6 +2651,73 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st } }
+ /* try changing compressed / allocation mode dynamically */ + if (callback->read_compressed) + { + callback->expect_time = 6500000; + hr = IWMReaderAdvanced2_DeliverTime(advanced, 6500000); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + wait_ontime_callback(callback); + ok(callback->last_pts[0] == 6500000, "Got pts %I64d.\n", callback->last_pts[0]); + ok(callback->next_pts[0] == 6960000, "Got pts %I64d.\n", callback->next_pts[0]); + ok(callback->last_pts[1] == 6460000, "Got pts %I64d.\n", callback->last_pts[1]); + ok(callback->next_pts[1] == 6470000, "Got pts %I64d.\n", callback->next_pts[1]); + ok(callback->sample_count > 0, "Got no samples.\n"); + callback->sample_count = 0; + + callback->todo_compressed = true; + callback->read_compressed = false; + hr = IWMReaderAdvanced2_SetReceiveStreamSamples(advanced, 1, FALSE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetReceiveStreamSamples(advanced, 2, FALSE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 0, TRUE); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 1, TRUE); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetAllocateForStream(advanced, 1, TRUE); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetAllocateForStream(advanced, 2, TRUE); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + + hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 0, callback->allocated_samples); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 1, callback->allocated_samples); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetAllocateForStream(advanced, 1, callback->allocated_compressed_samples); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetAllocateForStream(advanced, 2, callback->allocated_compressed_samples); + todo_wine + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + + callback->expect_time = 13460000; + hr = IWMReaderAdvanced2_DeliverTime(advanced, 13460000); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + wait_ontime_callback(callback); + todo_wine + ok(callback->last_pts[0] == 13460000, "Got pts %I64d.\n", callback->last_pts[0]); + todo_wine + ok(callback->next_pts[0] == 13930000, "Got pts %I64d.\n", callback->next_pts[0]); + ok(callback->last_pts[1] == 13260000, "Got pts %I64d.\n", callback->last_pts[1]); + ok(callback->next_pts[1] == 13270000, "Got pts %I64d.\n", callback->next_pts[1]); + ok(callback->sample_count > 0, "Got no samples.\n"); + callback->sample_count = 0; + + callback->read_compressed = true; + hr = IWMReaderAdvanced2_SetReceiveStreamSamples(advanced, 1, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMReaderAdvanced2_SetReceiveStreamSamples(advanced, 2, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + } + callback->expect_time = test_wmv_duration * 2; hr = IWMReaderAdvanced2_DeliverTime(advanced, test_wmv_duration * 2); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2668,6 +2749,7 @@ static void run_async_reader(IWMReader *reader, IWMReaderAdvanced2 *advanced, st wait_stopped_callback(callback); wait_stopped_callback(callback);
+ callback->todo_compressed = false; ok(!outstanding_buffers, "Got %ld outstanding buffers.\n", outstanding_buffers); }
@@ -2678,6 +2760,7 @@ static void test_async_reader_allocate(IWMReader *reader, HRESULT hr;
callback->allocated_samples = true; + callback->allocated_compressed_samples = false;
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2723,6 +2806,7 @@ static void test_async_reader_allocate(IWMReader *reader, run_async_reader(reader, advanced, callback);
callback->allocated_samples = false; + callback->allocated_compressed_samples = true;
hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 0, FALSE); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2758,6 +2842,8 @@ static void test_async_reader_allocate(IWMReader *reader, ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_SetAllocateForStream(advanced, 2, FALSE); ok(hr == S_OK, "Got hr %#lx.\n", hr); + + callback->allocated_compressed_samples = false; }
static void test_async_reader_selection(IWMReader *reader, @@ -2881,7 +2967,7 @@ static void test_async_reader_allocate_compressed(IWMReader *reader, hr = IWMReaderAdvanced2_SetReceiveStreamSamples(advanced, 2, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr);
- callback->allocated_samples = true; + callback->allocated_compressed_samples = true;
hr = IWMReaderAdvanced2_SetAllocateForStream(advanced, 1, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2900,7 +2986,8 @@ static void test_async_reader_allocate_compressed(IWMReader *reader, hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 1, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr);
- callback->allocated_samples = false; + callback->allocated_compressed_samples = false; + callback->allocated_samples = true;
run_async_reader(reader, advanced, callback);
@@ -2914,6 +3001,7 @@ static void test_async_reader_allocate_compressed(IWMReader *reader, hr = IWMReaderAdvanced2_SetReceiveStreamSamples(advanced, 2, FALSE); ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ callback->allocated_samples = false; callback->read_compressed = false; }
@@ -3746,6 +3834,7 @@ static void test_sync_reader_allocator(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
callback.allocated_samples = true; + callback.allocated_compressed_samples = true;
hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3764,7 +3853,7 @@ static void test_sync_reader_allocator(void) INSSBuffer_Release(sample);
callback.allocated_samples = false; - + callback.allocated_compressed_samples = false;
/* without compressed sample read, allocator isn't used */ hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); @@ -3796,6 +3885,7 @@ static void test_sync_reader_allocator(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
callback.allocated_samples = true; + callback.allocated_compressed_samples = true;
hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 1, &stream_num); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3816,7 +3906,7 @@ static void test_sync_reader_allocator(void) INSSBuffer_Release(sample);
callback.allocated_samples = false; - + callback.allocated_compressed_samples = false;
IWMSyncReader2_Release(reader);
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=126855
Your paranoid android.
=== debian11 (32 bit report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
Report validation errors: advapi32:security has no test summary line (early exit of the main process?) advapi32:security has unaccounted for todo messages
=== debian11 (32 bit ar:MA report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11 (32 bit de report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11 (32 bit fr report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11 (32 bit he:IL report) ===
wmvcore: wmvcore.c:500: Test failed: got wrong thread wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11 (32 bit hi:IN report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11 (32 bit ja:JP report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11 (32 bit zh:CN report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11b (32 bit WoW report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.
=== debian11b (64 bit WoW report) ===
wmvcore: wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000. wmvcore.c:2662: Test failed: Got pts 6964399. wmvcore.c:2664: Test failed: Got pts 6860000. wmvcore.c:2709: Test failed: Got pts 13460000. wmvcore.c:2710: Test failed: Got pts 13924399. wmvcore.c:2729: Test succeeded inside todo block: Got pts 19960000.