Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 99 +++++++++++++++++---------------- dlls/quartz/tests/filtergraph.c | 4 +- 2 files changed, 52 insertions(+), 51 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 96c9ae31f0..966f427b15 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2552,64 +2552,65 @@ static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, LONGL return S_OK; }
-struct pos_args { - LONGLONG* current, *stop; - DWORD curflags, stopflags; -}; - -static HRESULT WINAPI found_setposition(IFilterGraphImpl *This, IMediaSeeking *seek, DWORD_PTR pargs) +static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *current_ptr, + DWORD current_flags, LONGLONG *stop_ptr, DWORD stop_flags) { - struct pos_args *args = (void*)pargs; - LONGLONG current = args->current ? *args->current : 0, stop = args->stop ? *args->stop : 0; - HRESULT hr; - - 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, - DWORD dwCurrentFlags, LONGLONG *pStop, DWORD dwStopFlags) -{ - 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; FILTER_STATE state; - struct pos_args args;
- TRACE("(%p/%p)->(%p, %08x, %p, %08x)\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags); + TRACE("graph %p, current %s, current_flags %#x, stop %s, stop_flags %#x.\n", graph, + current_ptr ? wine_dbgstr_longlong(*current_ptr) : "<null>", current_flags, + stop_ptr ? wine_dbgstr_longlong(*stop_ptr): "<null>", stop_flags);
- EnterCriticalSection(&This->cs); - state = This->state; - TRACE("State: %s\n", state == State_Running ? "Running" : (state == State_Paused ? "Paused" : (state == State_Stopped ? "Stopped" : "UNKNOWN"))); + if ((current_flags & 0x7) != AM_SEEKING_AbsolutePositioning + && (current_flags & 0x7) != AM_SEEKING_NoPositioning) + FIXME("Unhandled current_flags %#x.\n", current_flags & 0x7);
- if ((dwCurrentFlags & 0x7) != AM_SEEKING_AbsolutePositioning && - (dwCurrentFlags & 0x7) != AM_SEEKING_NoPositioning) - FIXME("Adjust method %x not handled yet!\n", dwCurrentFlags & 0x7); + if ((stop_flags & 0x7) != AM_SEEKING_NoPositioning + && (stop_flags & 0x7) != AM_SEEKING_AbsolutePositioning) + FIXME("Unhandled stop_flags %#x.\n", stop_flags & 0x7);
- if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning - && (dwStopFlags & 0x7) != AM_SEEKING_AbsolutePositioning) - FIXME("Stop position not handled yet!\n"); + EnterCriticalSection(&graph->cs);
- if (state == State_Running && !(dwCurrentFlags & AM_SEEKING_NoFlush)) - IMediaControl_Pause(&This->IMediaControl_iface); - args.current = pCurrent; - args.stop = pStop; - args.curflags = dwCurrentFlags; - args.stopflags = dwStopFlags; - hr = all_renderers_seek(This, found_setposition, (DWORD_PTR)&args); + state = graph->state; + if (state == State_Running && !(current_flags & AM_SEEKING_NoFlush)) + IMediaControl_Pause(&graph->IMediaControl_iface);
- if ((dwCurrentFlags & 0x7) != AM_SEEKING_NoPositioning) - This->pause_time = This->start_time = -1; - if (state == State_Running && !(dwCurrentFlags & AM_SEEKING_NoFlush)) - IMediaControl_Run(&This->IMediaControl_iface); - LeaveCriticalSection(&This->cs); + LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) + { + LONGLONG current = current_ptr ? *current_ptr : 0, stop = stop_ptr ? *stop_ptr : 0;
+ if (FAILED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&seeking))) + continue; + + filter_hr = IMediaSeeking_SetPositions(seeking, ¤t, current_flags, &stop, stop_flags); + IMediaSeeking_Release(seeking); + if (SUCCEEDED(filter_hr)) + { + hr = S_OK; + + if (current_ptr && (current_flags & AM_SEEKING_ReturnTime)) + *current_ptr = current; + if (stop_ptr && (stop_flags & AM_SEEKING_ReturnTime)) + *stop_ptr = stop; + } + else if (filter_hr != E_NOTIMPL) + { + LeaveCriticalSection(&graph->cs); + return filter_hr; + } + } + + if ((current_flags & 0x7) != AM_SEEKING_NoPositioning) + graph->pause_time = graph->start_time = -1; + + if (state == State_Running && !(current_flags & AM_SEEKING_NoFlush)) + IMediaControl_Run(&graph->IMediaControl_iface); + + LeaveCriticalSection(&graph->cs); return hr; }
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index a768b737fb..bffbc82b98 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3818,12 +3818,12 @@ static void test_graph_seeking(void) 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); + 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); + ok(hr == S_OK, "Got hr %#x.\n", hr);
filter1.seek_hr = 0xdeadbeef; hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 47 +++++++++++++++++++++------------ dlls/quartz/tests/filtergraph.c | 12 ++++----- 2 files changed, 36 insertions(+), 23 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 966f427b15..f7ca192c13 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -210,6 +210,8 @@ typedef struct _IFilterGraphImpl {
HANDLE message_thread, message_thread_ret; DWORD message_thread_id; + + LONGLONG current_pos; } IFilterGraphImpl;
struct enum_filters @@ -2505,27 +2507,32 @@ static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLON return hr; }
-static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *pCurrent) +static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *current) { - IFilterGraphImpl *This = impl_from_IMediaSeeking(iface); - LONGLONG time = 0; + IFilterGraphImpl *graph = impl_from_IMediaSeeking(iface); + LONGLONG ret = graph->current_pos;
- if (!pCurrent) + TRACE("graph %p, current %p.\n", graph, current); + + if (!current) return E_POINTER;
- EnterCriticalSection(&This->cs); - if (This->state == State_Running && This->refClock && This->start_time >= 0) - { - IReferenceClock_GetTime(This->refClock, &time); - if (time) - time -= This->start_time; - } - if (This->pause_time > 0) - time += This->pause_time; - *pCurrent = time; - LeaveCriticalSection(&This->cs); + EnterCriticalSection(&graph->cs);
- TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent / 10000)%1000)); + if (graph->state == State_Running && graph->refClock && graph->start_time >= 0) + { + REFERENCE_TIME time; + IReferenceClock_GetTime(graph->refClock, &time); + if (time) + ret += time - graph->start_time; + } + + if (graph->pause_time > 0) + ret += graph->pause_time; + LeaveCriticalSection(&graph->cs); + + TRACE("Returning %s.\n", wine_dbgstr_longlong(ret)); + *current = ret;
return S_OK; } @@ -2586,7 +2593,8 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * if (FAILED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&seeking))) continue;
- filter_hr = IMediaSeeking_SetPositions(seeking, ¤t, current_flags, &stop, stop_flags); + filter_hr = IMediaSeeking_SetPositions(seeking, ¤t, + current_flags | AM_SEEKING_ReturnTime, &stop, stop_flags); IMediaSeeking_Release(seeking); if (SUCCEEDED(filter_hr)) { @@ -2596,6 +2604,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * *current_ptr = current; if (stop_ptr && (stop_flags & AM_SEEKING_ReturnTime)) *stop_ptr = stop; + graph->current_pos = current; } else if (filter_hr != E_NOTIMPL) { @@ -5220,7 +5229,10 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface) IFilterGraph2_SetDefaultSyncSource(&graph->IFilterGraph2_iface);
if (graph->state == State_Running && graph->refClock && graph->start_time >= 0) + { IReferenceClock_GetTime(graph->refClock, &graph->pause_time); + graph->current_pos += graph->pause_time - graph->start_time; + } else graph->pause_time = -1;
@@ -5714,6 +5726,7 @@ static HRESULT filter_graph_common_create(IUnknown *outer, void **out, BOOL thre fimpl->punkFilterMapper2 = NULL; fimpl->recursioncount = 0; fimpl->version = 0; + fimpl->current_pos = 0;
if (threaded) { diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index bffbc82b98..d5e205ef79 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3838,12 +3838,12 @@ static void test_graph_seeking(void)
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)); + 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 == 12340000, "Got time %s.\n", wine_dbgstr_longlong(current)); + ok(current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(current)); ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
current = 0x123; @@ -3908,12 +3908,12 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetCurrentPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(abs(time - 1234 * 10000) < 40 * 10000, + 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, + 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));
@@ -3921,12 +3921,12 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetCurrentPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(abs(time - 1334 * 10000) < 40 * 10000, + 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, + 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));
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 4 ++++ dlls/quartz/tests/filtergraph.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index f7ca192c13..182ea5a2be 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -5207,6 +5207,10 @@ static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface) SendFilterMessage(graph, SendStop, 0); graph->state = State_Stopped;
+ /* Update the current position, probably to synchronize multiple streams. */ + IMediaSeeking_SetPositions(&graph->IMediaSeeking_iface, &graph->current_pos, + AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); + LeaveCriticalSection(&graph->cs); return S_OK; } diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index d5e205ef79..4b9b3b675c 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3952,7 +3952,7 @@ static void test_graph_seeking(void) 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)); + 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); @@ -3968,7 +3968,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, "Got time %s.\n", wine_dbgstr_longlong(current)); - todo_wine ok(!stop, "Got time %s.\n", wine_dbgstr_longlong(stop)); + ok(!stop, "Got time %s.\n", wine_dbgstr_longlong(stop));
hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 4 ++-- dlls/quartz/tests/filtergraph.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 182ea5a2be..9750e6fe84 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2583,7 +2583,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * EnterCriticalSection(&graph->cs);
state = graph->state; - if (state == State_Running && !(current_flags & AM_SEEKING_NoFlush)) + if (state == State_Running) IMediaControl_Pause(&graph->IMediaControl_iface);
LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) @@ -2616,7 +2616,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * if ((current_flags & 0x7) != AM_SEEKING_NoPositioning) graph->pause_time = graph->start_time = -1;
- if (state == State_Running && !(current_flags & AM_SEEKING_NoFlush)) + if (state == State_Running) IMediaControl_Run(&graph->IMediaControl_iface);
LeaveCriticalSection(&graph->cs); diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 4b9b3b675c..3ef610d76b 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3917,6 +3917,14 @@ static void test_graph_seeking(void) "Expected about 1234ms, got %s.\n", wine_dbgstr_longlong(current)); ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
+ /* This remains true even if NoFlush is specified. */ + current = 1000 * 10000; + stop = 8000 * 10000; + hr = IMediaSeeking_SetPositions(seeking, ¤t, + AM_SEEKING_AbsolutePositioning | AM_SEEKING_NoFlush, + &stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_NoFlush); + ok(hr == S_OK, "Got hr %#x.\n", hr); + Sleep(100);
hr = IMediaSeeking_GetCurrentPosition(seeking, &time); @@ -3928,7 +3936,7 @@ static void test_graph_seeking(void) ok(hr == S_OK, "Got hr %#x.\n", hr); 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)); + ok(stop == 8000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
hr = IMediaControl_Pause(control); todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -3946,7 +3954,7 @@ static void test_graph_seeking(void) 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)); + ok(stop == 8000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr);
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=58160
Your paranoid android.
=== w8adm (32 bit report) ===
quartz: filtergraph.c:527: Test failed: didn't get EOS
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 46 ++++++++++++++++----------------- dlls/quartz/tests/filtergraph.c | 4 +-- 2 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 9750e6fe84..d5442e21fc 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -202,8 +202,6 @@ typedef struct _IFilterGraphImpl { int nItfCacheEntries; BOOL defaultclock; GUID timeformatseek; - REFERENCE_TIME start_time; - REFERENCE_TIME pause_time; LONG recursioncount; IUnknown *pSite; LONG version; @@ -211,6 +209,10 @@ typedef struct _IFilterGraphImpl { HANDLE message_thread, message_thread_ret; DWORD message_thread_id;
+ /* Respectively: the last timestamp at which we started streaming, and the + * current offset within the stream. */ + REFERENCE_TIME stream_start, stream_elapsed; + LONGLONG current_pos; } IFilterGraphImpl;
@@ -2519,16 +2521,14 @@ static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONG
EnterCriticalSection(&graph->cs);
- if (graph->state == State_Running && graph->refClock && graph->start_time >= 0) + if (graph->state == State_Running && graph->refClock) { REFERENCE_TIME time; IReferenceClock_GetTime(graph->refClock, &time); if (time) - ret += time - graph->start_time; + ret += time - graph->stream_start; }
- if (graph->pause_time > 0) - ret += graph->pause_time; LeaveCriticalSection(&graph->cs);
TRACE("Returning %s.\n", wine_dbgstr_longlong(ret)); @@ -2613,8 +2613,11 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * } }
- if ((current_flags & 0x7) != AM_SEEKING_NoPositioning) - graph->pause_time = graph->start_time = -1; + if ((current_flags & 0x7) != AM_SEEKING_NoPositioning && graph->refClock) + { + IReferenceClock_GetTime(graph->refClock, &graph->stream_start); + graph->stream_elapsed = 0; + }
if (state == State_Running) IMediaControl_Run(&graph->IMediaControl_iface); @@ -5232,13 +5235,13 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface) if (graph->defaultclock && !graph->refClock) IFilterGraph2_SetDefaultSyncSource(&graph->IFilterGraph2_iface);
- if (graph->state == State_Running && graph->refClock && graph->start_time >= 0) + if (graph->state == State_Running && graph->refClock) { - IReferenceClock_GetTime(graph->refClock, &graph->pause_time); - graph->current_pos += graph->pause_time - graph->start_time; + REFERENCE_TIME time; + IReferenceClock_GetTime(graph->refClock, &time); + graph->stream_elapsed += time - graph->stream_start; + graph->current_pos += graph->stream_elapsed; } - else - graph->pause_time = -1;
SendFilterMessage(graph, SendPause, 0); graph->state = State_Paused; @@ -5250,6 +5253,7 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface) static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME start) { IFilterGraphImpl *graph = impl_from_IMediaFilter(iface); + REFERENCE_TIME stream_start = start;
TRACE("graph %p, start %s.\n", graph, wine_dbgstr_longlong(start));
@@ -5267,19 +5271,13 @@ static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME start)
if (!start && graph->refClock) { - REFERENCE_TIME now; - IReferenceClock_GetTime(graph->refClock, &now); + IReferenceClock_GetTime(graph->refClock, &graph->stream_start); + stream_start = graph->stream_start - graph->stream_elapsed; if (graph->state == State_Stopped) - graph->start_time = now + 500000; - else if (graph->pause_time >= 0) - graph->start_time += now - graph->pause_time; - else - graph->start_time = now; + stream_start += 500000; } - else - graph->start_time = start;
- SendFilterMessage(graph, SendRun, (DWORD_PTR)&graph->start_time); + SendFilterMessage(graph, SendRun, (DWORD_PTR)&stream_start); graph->state = State_Running;
LeaveCriticalSection(&graph->cs); @@ -5726,7 +5724,7 @@ static HRESULT filter_graph_common_create(IUnknown *outer, void **out, BOOL thre fimpl->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IFilterGraphImpl.cs"); fimpl->nItfCacheEntries = 0; memcpy(&fimpl->timeformatseek, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID)); - fimpl->start_time = fimpl->pause_time = 0; + fimpl->stream_start = fimpl->stream_elapsed = 0; fimpl->punkFilterMapper2 = NULL; fimpl->recursioncount = 0; fimpl->version = 0; diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 3ef610d76b..14f2dfaa7a 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3947,12 +3947,12 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetCurrentPosition(seeking, &time); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(abs(time - 1334 * 10000) < 40 * 10000, + 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, + ok(abs(current - 1334 * 10000) < 40 * 10000, "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(current)); ok(stop == 8000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(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=58157
Your paranoid android.
=== w1064v1809_ar (32 bit report) ===
quartz: filtergraph.c:438: Test failed: GetState() failed: 40237 filtergraph.c:444: Test failed: GetState() failed: 40237 filtergraph.c:450: Test failed: GetState() failed: 40237 filtergraph.c:527: Test failed: didn't get EOS filtergraph.c:532: Test failed: expected 2ccdba, got 0