Rebase against d82f06c07556408e9584d2a1f8b275df39c93d74

This commit is contained in:
Alistair Leslie-Hughes
2019-10-23 09:40:18 +11:00
parent a568bd3e79
commit e380c1e9a7
14 changed files with 153 additions and 359 deletions

View File

@@ -1,58 +0,0 @@
From fb2417ad73fb67b20340a65d645b9dac245bdbf0 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 22 Jul 2014 08:26:47 -0600
Subject: quartz: Include the stream position in addition to the reference
clock offset in the time returned by MediaSeeking_GetPositions.
---
dlls/quartz/filtergraph.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 771a330..ad24691 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -2539,16 +2539,37 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *
return hr;
}
+static HRESULT WINAPI found_getposition(IFilterGraphImpl *This, IMediaSeeking *seek, DWORD_PTR pargs)
+{
+ struct pos_args *args = (void*)pargs;
+
+ return IMediaSeeking_GetPositions(seek, args->current, args->stop);
+}
+
static HRESULT WINAPI MediaSeeking_GetPositions(IMediaSeeking *iface, LONGLONG *pCurrent,
LONGLONG *pStop)
{
IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
+ struct pos_args args;
+ LONGLONG time = 0;
HRESULT hr;
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pCurrent, pStop);
- hr = IMediaSeeking_GetCurrentPosition(iface, pCurrent);
- if (SUCCEEDED(hr))
- hr = IMediaSeeking_GetStopPosition(iface, pStop);
+
+ args.current = pCurrent;
+ args.stop = pStop;
+ EnterCriticalSection(&This->cs);
+ hr = all_renderers_seek(This, found_getposition, (DWORD_PTR)&args);
+ 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);
return hr;
}
--
1.7.9.5

View File

@@ -1,71 +0,0 @@
From 5e1836cb61edfb4940ced2b9fd44efc93c2d3e82 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 22 Jul 2014 08:27:52 -0600
Subject: quartz: Implement MediaSeeking_GetCurrentPosition on top of
MediaSeeking_GetPositions.
---
dlls/quartz/filtergraph.c | 40 +++++++++++++++-------------------------
1 file changed, 15 insertions(+), 25 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index ad24691..0491131 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -2451,31 +2451,6 @@ static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLON
return hr;
}
-static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *pCurrent)
-{
- IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
- LONGLONG time = 0;
-
- if (!pCurrent)
- 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);
-
- TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent / 10000)%1000));
-
- return S_OK;
-}
-
static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *pTarget,
const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
{
@@ -2574,6 +2549,21 @@ static HRESULT WINAPI MediaSeeking_GetPositions(IMediaSeeking *iface, LONGLONG *
return hr;
}
+static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *pCurrent)
+{
+ LONGLONG time;
+ HRESULT hr;
+
+ if (!pCurrent)
+ return E_POINTER;
+
+ hr = MediaSeeking_GetPositions(iface, pCurrent, &time);
+
+ TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent / 10000)%1000));
+
+ return hr;
+}
+
static HRESULT WINAPI MediaSeeking_GetAvailable(IMediaSeeking *iface, LONGLONG *pEarliest,
LONGLONG *pLatest)
{
--
1.7.9.5