Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index e5be0af908..6811fb241d 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3136,6 +3136,16 @@ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); check_filter_state(graph, State_Paused);
+ hr = IMediaFilter_Run(filter, 0xdeadf00d); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Running); + ok(source.start_time == 0xdeadf00d, "Got time %s.\n", wine_dbgstr_longlong(source.start_time)); + ok(sink.start_time == 0xdeadf00d, "Got time %s.\n", wine_dbgstr_longlong(sink.start_time)); + + hr = IMediaFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Paused); + hr = IMediaFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); check_filter_state(graph, State_Stopped); @@ -3152,6 +3162,35 @@ todo_wine ok(sink.start_time == source.start_time, "Expected time %s, got %s.\n", wine_dbgstr_longlong(source.start_time), wine_dbgstr_longlong(sink.start_time));
+ Sleep(600); + hr = IMediaFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Paused); + + hr = IMediaFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Running); + ok(source.start_time >= start_time && source.start_time < start_time + 500 * 10000, + "Expected time near %s, got %s.\n", + wine_dbgstr_longlong(start_time), wine_dbgstr_longlong(source.start_time)); + ok(sink.start_time == source.start_time, "Expected time %s, got %s.\n", + wine_dbgstr_longlong(source.start_time), wine_dbgstr_longlong(sink.start_time)); + + hr = IMediaFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Paused); + Sleep(600); + + start_time += 600 * 10000; + hr = IMediaFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Running); + ok(source.start_time >= start_time && source.start_time < start_time + 500 * 10000, + "Expected time near %s, got %s.\n", + wine_dbgstr_longlong(start_time), wine_dbgstr_longlong(source.start_time)); + ok(sink.start_time == source.start_time, "Expected time %s, got %s.\n", + wine_dbgstr_longlong(source.start_time), wine_dbgstr_longlong(sink.start_time)); + hr = IMediaFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); check_filter_state(graph, State_Stopped);
Partly to further prove incorrect the patches currently in Staging.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 162 +++++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 14 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 6811fb241d..386e87086a 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -1165,7 +1165,7 @@ struct testfilter struct testpin *pins; unsigned int pin_count, enum_idx;
- HRESULT state_hr; + HRESULT state_hr, seek_hr;
IAMFilterMiscFlags IAMFilterMiscFlags_iface; ULONG misc_flags; @@ -1603,13 +1603,16 @@ static HRESULT WINAPI testseek_GetStopPosition(IMediaSeeking *iface, LONGLONG *s struct testfilter *filter = impl_from_IMediaSeeking(iface); if (winetest_debug > 1) trace("%p->GetStopPosition()\n", iface); *stop = filter->seek_stop; - return S_OK; + return filter->seek_hr; }
static HRESULT WINAPI testseek_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *current) { - ok(0, "Unexpected call.\n"); - return E_NOTIMPL; + struct testfilter *filter = impl_from_IMediaSeeking(iface); + if (winetest_debug > 1) trace("%p->GetCurrentPosition()\n", iface); + ok(!filter->clock, "GetCurrentPosition() should only be called if there is no sync source.\n"); + *current = 0xdeadbeef; + return S_OK; }
static HRESULT WINAPI testseek_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *target, @@ -1625,11 +1628,12 @@ static HRESULT WINAPI testseek_SetPositions(IMediaSeeking *iface, LONGLONG *curr struct testfilter *filter = impl_from_IMediaSeeking(iface); if (winetest_debug > 1) trace("%p->SetPositions(%s, %#x, %s, %#x)\n", iface, wine_dbgstr_longlong(*current), current_flags, wine_dbgstr_longlong(*stop), stop_flags); + ok(filter->state != State_Running, "Filter should be paused or stopped while seeking.\n"); filter->seek_current = *current; filter->seek_stop = *stop; - *current = 0x1234; - *stop = 0x4321; - return S_OK; + *current = 12340000; + *stop = 43210000; + return filter->seek_hr; }
static HRESULT WINAPI testseek_GetPositions(IMediaSeeking *iface, LONGLONG *current, LONGLONG *stop) @@ -3490,7 +3494,9 @@ static void test_graph_seeking(void)
LONGLONG time, current, stop, earliest, latest; IFilterGraph2 *graph = create_graph(); + IMediaControl *control; IMediaSeeking *seeking; + IMediaFilter *filter; unsigned int i; double rate; GUID format; @@ -3525,7 +3531,9 @@ static void test_graph_seeking(void) filter1.IMediaSeeking_iface.lpVtbl = &testseek_vtbl; filter2.IMediaSeeking_iface.lpVtbl = &testseek_vtbl;
+ IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); IFilterGraph2_QueryInterface(graph, &IID_IMediaSeeking, (void **)&seeking); + IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter);
hr = IMediaSeeking_GetCapabilities(seeking, &caps); todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -3788,6 +3796,25 @@ static void test_graph_seeking(void) ok(hr == S_OK, "Got hr %#x.\n", hr); todo_wine ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time));
+ filter1.seek_hr = filter2.seek_hr = 0xbeef; + hr = IMediaSeeking_GetStopPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time)); + + filter1.seek_hr = E_NOTIMPL; + hr = IMediaSeeking_GetStopPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(time == 0x54321, "Got time %s.\n", wine_dbgstr_longlong(time)); + + filter1.seek_hr = 0xdeadbeef; + hr = IMediaSeeking_GetStopPosition(seeking, &time); + todo_wine ok(hr == 0xdeadbeef, "Got hr %#x.\n", hr); + + filter1.seek_hr = filter2.seek_hr = E_NOTIMPL; + hr = IMediaSeeking_GetStopPosition(seeking, &time); + todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + filter1.seek_hr = filter2.seek_hr = S_OK; + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!time, "Got time %s.\n", wine_dbgstr_longlong(time)); @@ -3810,24 +3837,45 @@ static void test_graph_seeking(void) 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));
+ filter1.seek_hr = filter2.seek_hr = 0xbeef; + hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning, + &stop, AM_SEEKING_AbsolutePositioning); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + filter1.seek_hr = E_NOTIMPL; + hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning, + &stop, AM_SEEKING_AbsolutePositioning); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + filter1.seek_hr = 0xdeadbeef; + hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning, + &stop, AM_SEEKING_AbsolutePositioning); + ok(hr == 0xdeadbeef, "Got hr %#x.\n", hr); + + filter1.seek_hr = filter2.seek_hr = E_NOTIMPL; + hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning, + &stop, AM_SEEKING_AbsolutePositioning); + ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + filter1.seek_hr = filter2.seek_hr = S_OK; + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(time == 0x1234, "Got time %s.\n", wine_dbgstr_longlong(time)); + todo_wine ok(time == 12340000, "Got time %s.\n", wine_dbgstr_longlong(time));
current = stop = 0xdeadbeef; hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(current == 0x1234, "Got time %s.\n", wine_dbgstr_longlong(current)); - ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop)); + 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));
current = 0x123; stop = 0x321; hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime, &stop, AM_SEEKING_AbsolutePositioning); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(current == 0x1234, "Got time %s.\n", wine_dbgstr_longlong(current)); + 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(filter1.seek_current == 0x1234, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current)); + 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(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)); @@ -3838,9 +3886,9 @@ static void test_graph_seeking(void) &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(stop == 0x4321, "Got time %s.\n", wine_dbgstr_longlong(stop)); + 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_stop == 0x4321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop)); + 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));
@@ -3863,6 +3911,92 @@ static void test_graph_seeking(void) ok(hr == S_OK, "Got hr %#x.\n", hr); todo_wine ok(rate == -1.0, "Got rate %.16e.\n", rate);
+ hr = IMediaSeeking_SetRate(seeking, 1.0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + /* Test how retrieving the current position behaves while the graph is + * running. Apparently the graph caches the last position returned by + * SetPositions() and then adds the clock offset to the stream start. */ + + hr = IMediaControl_Run(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + /* Note that if the graph is running, it is paused while seeking. */ + current = 0; + stop = 9000 * 10000; + hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning, + &stop, AM_SEEKING_AbsolutePositioning); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(abs(time - 1234 * 10000) < 40 * 10000, + "Expected about 1234ms, got %s.\n", wine_dbgstr_longlong(time)); + current = stop = 0xdeadbeef; + hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(abs(current - 1234 * 10000) < 40 * 10000, + "Expected about 1234ms, got %s.\n", wine_dbgstr_longlong(current)); + ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop)); + + Sleep(100); + + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(abs(time - 1334 * 10000) < 40 * 10000, + "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(time)); + current = stop = 0xdeadbeef; + hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(abs(current - 1334 * 10000) < 40 * 10000, + "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(current)); + ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop)); + + hr = IMediaControl_Pause(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + Sleep(100); + hr = IMediaControl_Run(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(abs(time - 1334 * 10000) < 40 * 10000, + "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(time)); + current = stop = 0xdeadbeef; + hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(abs(current - 1334 * 10000) < 40 * 10000, + "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(current)); + ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop)); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(time == 12340000, "Got time %s.\n", wine_dbgstr_longlong(time)); + + hr = IMediaFilter_SetSyncSource(filter, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_Run(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + Sleep(100); + hr = IMediaSeeking_GetCurrentPosition(seeking, &time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(!time, "Got time %s.\n", wine_dbgstr_longlong(time)); + current = stop = 0xdeadbeef; + hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(!current, "Got time %s.\n", wine_dbgstr_longlong(current)); + todo_wine ok(!stop, "Got time %s.\n", wine_dbgstr_longlong(stop)); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + IMediaFilter_Release(filter); + IMediaControl_Release(control); IMediaSeeking_Release(seeking); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", hr);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 43 ++++++++++++++++++++++++--------- dlls/quartz/tests/filtergraph.c | 14 +++++------ 2 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 9d60d4332b..024f0bd1a5 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2466,24 +2466,43 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking *iface, LONGLONG *p return hr; }
-static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLONG *pStop) +static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLONG *stop) { - IFilterGraphImpl *This = impl_from_IMediaSeeking(iface); - HRESULT hr = S_OK; + IFilterGraphImpl *graph = impl_from_IMediaSeeking(iface); + HRESULT hr = E_NOTIMPL, filter_hr; + IMediaSeeking *seeking; + struct filter *filter; + LONGLONG filter_stop;
- TRACE("(%p/%p)->(%p)\n", This, iface, pStop); + TRACE("graph %p, stop %p.\n", graph, stop);
- if (!pStop) + if (!stop) return E_POINTER;
- EnterCriticalSection(&This->cs); - if (This->stop_position < 0) - /* Stop position not set, use duration instead */ - hr = IMediaSeeking_GetDuration(iface, pStop); - else - *pStop = This->stop_position; - LeaveCriticalSection(&This->cs); + *stop = 0;
+ EnterCriticalSection(&graph->cs); + + LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) + { + if (FAILED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&seeking))) + continue; + + filter_hr = IMediaSeeking_GetStopPosition(seeking, &filter_stop); + IMediaSeeking_Release(seeking); + if (SUCCEEDED(filter_hr)) + { + hr = S_OK; + *stop = max(*stop, filter_stop); + } + else if (filter_hr != E_NOTIMPL) + { + LeaveCriticalSection(&graph->cs); + return filter_hr; + } + } + + LeaveCriticalSection(&graph->cs); return hr; }
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 386e87086a..2ec9c52e47 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3788,31 +3788,31 @@ static void test_graph_seeking(void) filter2.seek_stop = 0x65432; hr = IMediaSeeking_GetStopPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time)); + ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time));
filter2.seek_stop = 0x54321; filter1.seek_stop = 0x65432; hr = IMediaSeeking_GetStopPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time)); + ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time));
filter1.seek_hr = filter2.seek_hr = 0xbeef; hr = IMediaSeeking_GetStopPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time)); + ok(time == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(time));
filter1.seek_hr = E_NOTIMPL; hr = IMediaSeeking_GetStopPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(time == 0x54321, "Got time %s.\n", wine_dbgstr_longlong(time)); + ok(time == 0x54321, "Got time %s.\n", wine_dbgstr_longlong(time));
filter1.seek_hr = 0xdeadbeef; hr = IMediaSeeking_GetStopPosition(seeking, &time); - todo_wine ok(hr == 0xdeadbeef, "Got hr %#x.\n", hr); + ok(hr == 0xdeadbeef, "Got hr %#x.\n", hr);
filter1.seek_hr = filter2.seek_hr = E_NOTIMPL; hr = IMediaSeeking_GetStopPosition(seeking, &time); - todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); filter1.seek_hr = filter2.seek_hr = S_OK;
hr = IMediaSeeking_GetCurrentPosition(seeking, &time); @@ -3823,7 +3823,7 @@ static void test_graph_seeking(void) hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!current, "Got time %s.\n", wine_dbgstr_longlong(current)); - todo_wine ok(stop == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(stop)); + ok(stop == 0x65432, "Got time %s.\n", wine_dbgstr_longlong(stop));
current = 0x123; stop = 0x321;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 024f0bd1a5..e74de6d033 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -204,7 +204,6 @@ typedef struct _IFilterGraphImpl { GUID timeformatseek; REFERENCE_TIME start_time; REFERENCE_TIME pause_time; - LONGLONG stop_position; LONG recursioncount; IUnknown *pSite; LONG version; @@ -2583,9 +2582,8 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * (dwCurrentFlags & 0x7) != AM_SEEKING_NoPositioning) FIXME("Adjust method %x not handled yet!\n", dwCurrentFlags & 0x7);
- if ((dwStopFlags & 0x7) == AM_SEEKING_AbsolutePositioning) - This->stop_position = *pStop; - else if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning) + if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning + && (dwStopFlags & 0x7) != AM_SEEKING_AbsolutePositioning) FIXME("Stop position not handled yet!\n");
if (state == State_Running && !(dwCurrentFlags & AM_SEEKING_NoFlush)) @@ -5702,7 +5700,6 @@ static HRESULT filter_graph_common_create(IUnknown *outer, void **out, BOOL thre fimpl->nItfCacheEntries = 0; memcpy(&fimpl->timeformatseek, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID)); fimpl->start_time = fimpl->pause_time = 0; - fimpl->stop_position = -1; fimpl->punkFilterMapper2 = NULL; fimpl->recursioncount = 0; fimpl->version = 0;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- 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..ef71fa6213 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 2ec9c52e47..5894ed2bde 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));
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58031
Your paranoid android.
=== debian10 (32 bit French report) ===
quartz: filtergraph: Timeout