quartz/filtergraph: Correctly handle AM_SEEKING_ReturnTime in IMediaSeeking::SetPositions().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-10-19 10:48:25 -05:00 committed by Alexandre Julliard
parent c1f2e8476d
commit 0705b0f182
2 changed files with 20 additions and 10 deletions

View File

@ -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, &current,
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,

View File

@ -3808,10 +3808,10 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_SetPositions(seeking, &current, 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));
@ -3844,7 +3844,7 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetPositions(seeking, &current, &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;
@ -3852,9 +3852,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));
@ -3863,9 +3863,9 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_SetPositions(seeking, &current, 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));