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
97f949b9
Commit
97f949b9
authored
Mar 11, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Shutdown samplegrabber event queue on sink shutdown.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
421e6b2b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
samplegrabber.c
dlls/mf/samplegrabber.c
+3
-3
mf.c
dlls/mf/tests/mf.c
+19
-1
No files found.
dlls/mf/samplegrabber.c
View file @
97f949b9
...
...
@@ -849,10 +849,7 @@ static ULONG WINAPI sample_grabber_sink_Release(IMFMediaSink *iface)
IMFSampleGrabberSinkCallback2_Release
(
grabber
->
callback2
);
IMFMediaType_Release
(
grabber
->
media_type
);
if
(
grabber
->
event_queue
)
{
IMFMediaEventQueue_Shutdown
(
grabber
->
event_queue
);
IMFMediaEventQueue_Release
(
grabber
->
event_queue
);
}
if
(
grabber
->
clock
)
IMFPresentationClock_Release
(
grabber
->
clock
);
if
(
grabber
->
timer
)
...
...
@@ -1045,12 +1042,15 @@ static HRESULT WINAPI sample_grabber_sink_Shutdown(IMFMediaSink *iface)
grabber
->
is_shut_down
=
TRUE
;
if
(
SUCCEEDED
(
hr
=
IMFSampleGrabberSinkCallback_OnShutdown
(
sample_grabber_get_callback
(
grabber
))))
{
/* Detach stream. */
IMFMediaSink_Release
(
&
grabber
->
stream
->
sink
->
IMFMediaSink_iface
);
EnterCriticalSection
(
&
grabber
->
stream
->
cs
);
grabber
->
stream
->
sink
=
NULL
;
LeaveCriticalSection
(
&
grabber
->
stream
->
cs
);
IMFStreamSink_Release
(
&
grabber
->
stream
->
IMFStreamSink_iface
);
grabber
->
stream
=
NULL
;
IMFMediaEventQueue_Shutdown
(
grabber
->
event_queue
);
}
LeaveCriticalSection
(
&
grabber
->
cs
);
...
...
dlls/mf/tests/mf.c
View file @
97f949b9
...
...
@@ -1925,6 +1925,7 @@ static void test_sample_grabber(void)
IMFMediaSink
*
sink
,
*
sink2
;
DWORD
flags
,
count
,
id
;
IMFActivate
*
activate
;
IMFMediaEvent
*
event
;
ULONG
refcount
;
IUnknown
*
unk
;
HRESULT
hr
;
...
...
@@ -1995,9 +1996,12 @@ static void test_sample_grabber(void)
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#x.
\n
"
,
hr
);
IMFClockStateSink_Release
(
clocksink
);
/* Event generator. */
hr
=
IMFMediaSink_QueryInterface
(
sink
,
&
IID_IMFMediaEventGenerator
,
(
void
**
)
&
eg
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#x.
\n
"
,
hr
);
IMFMediaEventGenerator_Release
(
eg
);
hr
=
IMFMediaEventGenerator_GetEvent
(
eg
,
MF_EVENT_FLAG_NO_WAIT
,
&
event
);
ok
(
hr
==
MF_E_NO_EVENTS_AVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_QueryInterface
(
sink
,
&
IID_IMFPresentationTimeSource
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -2130,9 +2134,18 @@ todo_wine
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEventGenerator_GetEvent
(
eg
,
MF_EVENT_FLAG_NO_WAIT
,
&
event
);
ok
(
hr
==
MF_E_NO_EVENTS_AVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetEvent
(
stream
,
MF_EVENT_FLAG_NO_WAIT
,
&
event
);
ok
(
hr
==
MF_E_NO_EVENTS_AVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_Shutdown
(
sink
);
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEventGenerator_GetEvent
(
eg
,
MF_EVENT_FLAG_NO_WAIT
,
&
event
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaSink_Shutdown
(
sink
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -2148,6 +2161,10 @@ todo_wine
hr
=
IMFMediaSink_GetStreamSinkByIndex
(
sink
,
0
,
&
stream2
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetEvent
(
stream
,
MF_EVENT_FLAG_NO_WAIT
,
&
event
);
todo_wine
ok
(
hr
==
MF_E_STREAMSINK_REMOVED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetMediaSink
(
stream
,
&
sink2
);
ok
(
hr
==
MF_E_STREAMSINK_REMOVED
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -2195,6 +2212,7 @@ todo_wine
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaEventGenerator_Release
(
eg
);
IMFMediaSink_Release
(
sink
);
IMFStreamSink_Release
(
stream
);
...
...
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