You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Move 18-quartz-MediaSeeking_Positions to quartz-MediaSeeking_Positions.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
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
|
||||
|
@@ -0,0 +1,72 @@
|
||||
From 77648650211d1750a49494b2d0bcf7943b58e1b1 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 | 41 ++++++++++++++++-------------------------
|
||||
1 file changed, 16 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
|
||||
index ad24691..4c093f3 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,22 @@ static HRESULT WINAPI MediaSeeking_GetPositions(IMediaSeeking *iface, LONGLONG *
|
||||
return hr;
|
||||
}
|
||||
|
||||
+static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *pCurrent)
|
||||
+{
|
||||
+ IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
|
||||
+ 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
|
||||
|
@@ -0,0 +1,68 @@
|
||||
From e2abc9b73d2e909f62468de5d66c5d9ec51fce0f Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Tue, 22 Jul 2014 08:32:31 -0600
|
||||
Subject: quartz: Implement MediaSeeking_GetStopPosition on top of
|
||||
MediaSeeking_GetPositions.
|
||||
|
||||
---
|
||||
dlls/quartz/filtergraph.c | 37 ++++++++++++++++---------------------
|
||||
1 file changed, 16 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
|
||||
index 4c093f3..0d06ba4 100644
|
||||
--- a/dlls/quartz/filtergraph.c
|
||||
+++ b/dlls/quartz/filtergraph.c
|
||||
@@ -2430,27 +2430,6 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking *iface, LONGLONG *p
|
||||
return hr;
|
||||
}
|
||||
|
||||
-static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLONG *pStop)
|
||||
-{
|
||||
- IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
|
||||
- HRESULT hr = S_OK;
|
||||
-
|
||||
- TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
|
||||
-
|
||||
- if (!pStop)
|
||||
- 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);
|
||||
-
|
||||
- return hr;
|
||||
-}
|
||||
-
|
||||
static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *pTarget,
|
||||
const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
|
||||
{
|
||||
@@ -2565,6 +2544,22 @@ static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONG
|
||||
return hr;
|
||||
}
|
||||
|
||||
+static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLONG *pStop)
|
||||
+{
|
||||
+ IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
|
||||
+ LONGLONG time;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
|
||||
+
|
||||
+ if (!pStop)
|
||||
+ return E_POINTER;
|
||||
+
|
||||
+ hr = MediaSeeking_GetPositions(iface, &time, pStop);
|
||||
+
|
||||
+ return hr;
|
||||
+}
|
||||
+
|
||||
static HRESULT WINAPI MediaSeeking_GetAvailable(IMediaSeeking *iface, LONGLONG *pEarliest,
|
||||
LONGLONG *pLatest)
|
||||
{
|
||||
--
|
||||
1.7.9.5
|
||||
|
@@ -0,0 +1,44 @@
|
||||
From 3c9438db949d434b8cb5fba36ee55df384624016 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Tue, 22 Jul 2014 08:34:09 -0600
|
||||
Subject: quartz: Remove unused cache of MediaSeeking stop position.
|
||||
|
||||
---
|
||||
dlls/quartz/filtergraph.c | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
|
||||
index 0d06ba4..df6b4bd 100644
|
||||
--- a/dlls/quartz/filtergraph.c
|
||||
+++ b/dlls/quartz/filtergraph.c
|
||||
@@ -201,7 +201,6 @@ typedef struct _IFilterGraphImpl {
|
||||
GUID timeformatseek;
|
||||
REFERENCE_TIME start_time;
|
||||
REFERENCE_TIME pause_time;
|
||||
- LONGLONG stop_position;
|
||||
LONG recursioncount;
|
||||
IUnknown *pSite;
|
||||
LONG version;
|
||||
@@ -2471,11 +2470,6 @@ 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)
|
||||
- FIXME("Stop position not handled yet!\n");
|
||||
-
|
||||
if (state == State_Running && !(dwCurrentFlags & AM_SEEKING_NoFlush))
|
||||
IMediaControl_Pause(&This->IMediaControl_iface);
|
||||
args.current = pCurrent;
|
||||
@@ -5669,7 +5663,6 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
|
||||
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;
|
||||
--
|
||||
1.7.9.5
|
||||
|
4
patches/quartz-MediaSeeking_Positions/definition
Normal file
4
patches/quartz-MediaSeeking_Positions/definition
Normal file
@@ -0,0 +1,4 @@
|
||||
Author: Erich E. Hoover
|
||||
Subject: Return correct IMediaSeeking stream positions in quartz.
|
||||
Revision: 1
|
||||
Fixes: [23174] Return correct IMediaSeeking stream positions in quartz
|
Reference in New Issue
Block a user