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
627b6b29
Commit
627b6b29
authored
Nov 21, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Correct return value handling in IMediaSeeking::GetDuration().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ec4feafc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
24 deletions
+33
-24
filtergraph.c
dlls/quartz/filtergraph.c
+31
-22
filtergraph.c
dlls/quartz/tests/filtergraph.c
+2
-2
No files found.
dlls/quartz/filtergraph.c
View file @
627b6b29
...
...
@@ -2237,36 +2237,45 @@ static HRESULT WINAPI MediaSeeking_SetTimeFormat(IMediaSeeking *iface, const GUI
return
S_OK
;
}
static
HRESULT
WINAPI
FoundDuration
(
struct
filter_graph
*
This
,
IMediaSeeking
*
seek
,
DWORD_PTR
p
duration
)
static
HRESULT
WINAPI
MediaSeeking_GetDuration
(
IMediaSeeking
*
iface
,
LONGLONG
*
duration
)
{
HRESULT
hr
;
LONGLONG
duration
=
0
,
*
pdur
=
(
LONGLONG
*
)
pduration
;
struct
filter_graph
*
graph
=
impl_from_IMediaSeeking
(
iface
);
HRESULT
hr
=
E_NOTIMPL
,
filter_hr
;
LONGLONG
filter_duration
;
struct
filter
*
filter
;
hr
=
IMediaSeeking_GetDuration
(
seek
,
&
duration
);
if
(
FAILED
(
hr
))
return
hr
;
TRACE
(
"graph %p, duration %p.
\n
"
,
graph
,
duration
);
if
(
*
pdur
<
duration
)
*
pdur
=
duration
;
return
hr
;
}
if
(
!
duration
)
return
E_POINTER
;
static
HRESULT
WINAPI
MediaSeeking_GetDuration
(
IMediaSeeking
*
iface
,
LONGLONG
*
pDuration
)
{
struct
filter_graph
*
This
=
impl_from_IMediaSeeking
(
iface
);
HRESULT
hr
;
*
duration
=
0
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pDuration
);
EnterCriticalSection
(
&
graph
->
cs
);
if
(
!
pDuration
)
return
E_POINTER
;
LIST_FOR_EACH_ENTRY
(
filter
,
&
graph
->
filters
,
struct
filter
,
entry
)
{
update_seeking
(
filter
);
if
(
!
filter
->
seeking
)
continue
;
EnterCriticalSection
(
&
This
->
cs
);
*
pDuration
=
0
;
hr
=
all_renderers_seek
(
This
,
FoundDuration
,
(
DWORD_PTR
)
pDuration
);
LeaveCriticalSection
(
&
This
->
cs
);
filter_hr
=
IMediaSeeking_GetDuration
(
filter
->
seeking
,
&
filter_duration
);
if
(
SUCCEEDED
(
filter_hr
))
{
hr
=
S_OK
;
*
duration
=
max
(
*
duration
,
filter_duration
);
}
else
if
(
filter_hr
!=
E_NOTIMPL
)
{
LeaveCriticalSection
(
&
graph
->
cs
);
return
filter_hr
;
}
}
LeaveCriticalSection
(
&
graph
->
cs
);
TRACE
(
"--->%08x
\n
"
,
hr
);
TRACE
(
"Returning hr %#x, duration %s (%s seconds).
\n
"
,
hr
,
wine_dbgstr_longlong
(
*
duration
),
debugstr_time
(
*
duration
));
return
hr
;
}
...
...
dlls/quartz/tests/filtergraph.c
View file @
627b6b29
...
...
@@ -4401,13 +4401,13 @@ static void test_graph_seeking(void)
filter1
.
seek_hr
=
filter2
.
seek_hr
=
0xbeef
;
hr
=
IMediaSeeking_GetDuration
(
seeking
,
&
time
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
time
==
0x23456
,
"Got time %s.
\n
"
,
wine_dbgstr_longlong
(
time
));
filter1
.
seek_hr
=
E_NOTIMPL
;
filter2
.
seek_hr
=
S_OK
;
hr
=
IMediaSeeking_GetDuration
(
seeking
,
&
time
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
time
==
0x12345
,
"Got time %s.
\n
"
,
wine_dbgstr_longlong
(
time
));
filter1
.
seek_hr
=
0xdeadbeef
;
...
...
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