[PATCH 5/5] quartz/filtergraph: Correctly handle AM_SEEKING_ReturnTime in IMediaSeeking::SetPositions().
Zebediah Figura
z.figura12 at gmail.com
Sat Oct 19 09:53:13 CDT 2019
---
dlls/quartz/filtergraph.c | 12 +++++++++++-
dlls/quartz/tests/filtergraph.c | 18 +++++++++---------
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index e74de6d033..7478741fb0 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -2560,8 +2560,18 @@ struct pos_args {
static HRESULT WINAPI found_setposition(IFilterGraphImpl *This, IMediaSeeking *seek, DWORD_PTR pargs)
{
struct pos_args *args = (void*)pargs;
+ LONGLONG current = args.current ? *args->current : 0, stop = args->stop ? *args->stop : 0;
+ HRESULT hr;
- return IMediaSeeking_SetPositions(seek, args->current, args->curflags, args->stop, args->stopflags);
+ if (SUCCEEDED(hr = IMediaSeeking_SetPositions(seek, ¤t,
+ args->curflags, &stop, args->stopflags)))
+ {
+ if (args->current && (args->curflags & AM_SEEKING_ReturnTime))
+ *args->current = current;
+ if (args->stop && (args->stopflags & AM_SEEKING_ReturnTime))
+ *args->stop = stop;
+ }
+ return hr;
}
static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *pCurrent,
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index f5535b60a2..1fb9be8025 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -3830,10 +3830,10 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning,
&stop, AM_SEEKING_AbsolutePositioning);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- todo_wine ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
- todo_wine ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
- todo_wine ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
- todo_wine ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
+ ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
+ ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
+ ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
+ ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
ok(filter2.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_current));
ok(filter2.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_stop));
@@ -3866,7 +3866,7 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(current));
- todo_wine ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
+ ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
current = 0x123;
stop = 0x321;
@@ -3874,9 +3874,9 @@ static void test_graph_seeking(void)
&stop, AM_SEEKING_AbsolutePositioning);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(current));
- todo_wine ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
+ ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
ok(filter1.seek_current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
- todo_wine ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
+ ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
ok(filter2.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_current));
ok(filter2.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_stop));
@@ -3885,9 +3885,9 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning,
&stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- todo_wine ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
+ ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
ok(stop == 43210000, "Got time %s.\n", wine_dbgstr_longlong(stop));
- todo_wine ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
+ ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
ok(filter1.seek_stop == 43210000, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
ok(filter2.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_current));
ok(filter2.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_stop));
--
2.20.1
More information about the wine-devel
mailing list