Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a0043c1c
Commit
a0043c1c
authored
Oct 19, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/filtergraph: Correctly implement IMediaSeeking::GetStopPosition().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
88c41a39
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
19 deletions
+38
-19
filtergraph.c
dlls/quartz/filtergraph.c
+31
-12
filtergraph.c
dlls/quartz/tests/filtergraph.c
+7
-7
No files found.
dlls/quartz/filtergraph.c
View file @
a0043c1c
...
@@ -2466,24 +2466,43 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking *iface, LONGLONG *p
...
@@ -2466,24 +2466,43 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking *iface, LONGLONG *p
return
hr
;
return
hr
;
}
}
static
HRESULT
WINAPI
MediaSeeking_GetStopPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pS
top
)
static
HRESULT
WINAPI
MediaSeeking_GetStopPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
s
top
)
{
{
IFilterGraphImpl
*
This
=
impl_from_IMediaSeeking
(
iface
);
IFilterGraphImpl
*
graph
=
impl_from_IMediaSeeking
(
iface
);
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
E_NOTIMPL
,
filter_hr
;
IMediaSeeking
*
seeking
;
struct
filter
*
filter
;
LONGLONG
filter_stop
;
TRACE
(
"
(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pS
top
);
TRACE
(
"
graph %p, stop %p.
\n
"
,
graph
,
s
top
);
if
(
!
pS
top
)
if
(
!
s
top
)
return
E_POINTER
;
return
E_POINTER
;
EnterCriticalSection
(
&
This
->
cs
);
*
stop
=
0
;
if
(
This
->
stop_position
<
0
)
/* Stop position not set, use duration instead */
EnterCriticalSection
(
&
graph
->
cs
);
hr
=
IMediaSeeking_GetDuration
(
iface
,
pStop
);
else
*
pStop
=
This
->
stop_position
;
LeaveCriticalSection
(
&
This
->
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
;
return
hr
;
}
}
...
...
dlls/quartz/tests/filtergraph.c
View file @
a0043c1c
...
@@ -3766,31 +3766,31 @@ static void test_graph_seeking(void)
...
@@ -3766,31 +3766,31 @@ static void test_graph_seeking(void)
filter2
.
seek_stop
=
0x65432
;
filter2
.
seek_stop
=
0x65432
;
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
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
;
filter2
.
seek_stop
=
0x54321
;
filter1
.
seek_stop
=
0x65432
;
filter1
.
seek_stop
=
0x65432
;
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
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
;
filter1
.
seek_hr
=
filter2
.
seek_hr
=
0xbeef
;
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
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
;
filter1
.
seek_hr
=
E_NOTIMPL
;
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
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
;
filter1
.
seek_hr
=
0xdeadbeef
;
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
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
;
filter1
.
seek_hr
=
filter2
.
seek_hr
=
E_NOTIMPL
;
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
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
;
filter1
.
seek_hr
=
filter2
.
seek_hr
=
S_OK
;
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
time
);
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
time
);
...
@@ -3801,7 +3801,7 @@ static void test_graph_seeking(void)
...
@@ -3801,7 +3801,7 @@ static void test_graph_seeking(void)
hr
=
IMediaSeeking_GetPositions
(
seeking
,
&
current
,
&
stop
);
hr
=
IMediaSeeking_GetPositions
(
seeking
,
&
current
,
&
stop
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
current
,
"Got time %s.
\n
"
,
wine_dbgstr_longlong
(
current
));
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
;
current
=
0x123
;
stop
=
0x321
;
stop
=
0x321
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment