Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ce37290a
Commit
ce37290a
authored
Apr 14, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Release queue subscriber on queue release.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e9a29249
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
main.c
dlls/mfplat/main.c
+2
-4
mfplat.c
dlls/mfplat/tests/mfplat.c
+19
-2
No files found.
dlls/mfplat/main.c
View file @
ce37290a
...
...
@@ -7019,6 +7019,7 @@ static void event_queue_cleanup(struct event_queue *queue)
while
((
event
=
queue_pop_event
(
queue
)))
IMFMediaEvent_Release
(
event
);
event_queue_clear_subscriber
(
queue
);
}
static
HRESULT
WINAPI
eventqueue_QueryInterface
(
IMFMediaEventQueue
*
iface
,
REFIID
riid
,
void
**
out
)
...
...
@@ -7162,9 +7163,7 @@ static HRESULT WINAPI eventqueue_EndGetEvent(IMFMediaEventQueue *iface, IMFAsync
else
if
(
queue
->
subscriber
==
(
IRtwqAsyncResult
*
)
result
)
{
*
event
=
queue_pop_event
(
queue
);
if
(
queue
->
subscriber
)
IRtwqAsyncResult_Release
(
queue
->
subscriber
);
queue
->
subscriber
=
NULL
;
event_queue_clear_subscriber
(
queue
);
queue
->
notified
=
FALSE
;
hr
=
*
event
?
S_OK
:
E_FAIL
;
}
...
...
@@ -7265,7 +7264,6 @@ static HRESULT WINAPI eventqueue_Shutdown(IMFMediaEventQueue *iface)
if
(
!
queue
->
is_shut_down
)
{
event_queue_cleanup
(
queue
);
event_queue_clear_subscriber
(
queue
);
queue
->
is_shut_down
=
TRUE
;
}
...
...
dlls/mfplat/tests/mfplat.c
View file @
ce37290a
...
...
@@ -326,6 +326,7 @@ static WCHAR *load_resource(const WCHAR *name)
struct
test_callback
{
IMFAsyncCallback
IMFAsyncCallback_iface
;
LONG
refcount
;
HANDLE
event
;
DWORD
param
;
IMFMediaEvent
*
media_event
;
...
...
@@ -352,12 +353,14 @@ static HRESULT WINAPI testcallback_QueryInterface(IMFAsyncCallback *iface, REFII
static
ULONG
WINAPI
testcallback_AddRef
(
IMFAsyncCallback
*
iface
)
{
return
2
;
struct
test_callback
*
callback
=
impl_from_IMFAsyncCallback
(
iface
);
return
InterlockedIncrement
(
&
callback
->
refcount
);
}
static
ULONG
WINAPI
testcallback_Release
(
IMFAsyncCallback
*
iface
)
{
return
1
;
struct
test_callback
*
callback
=
impl_from_IMFAsyncCallback
(
iface
);
return
InterlockedDecrement
(
&
callback
->
refcount
);
}
static
HRESULT
WINAPI
testcallback_GetParameters
(
IMFAsyncCallback
*
iface
,
DWORD
*
flags
,
DWORD
*
queue
)
...
...
@@ -2462,6 +2465,7 @@ static void init_test_callback(struct test_callback *callback)
{
callback
->
IMFAsyncCallback_iface
.
lpVtbl
=
&
testcallbackvtbl
;
callback
->
event
=
NULL
;
callback
->
refcount
=
1
;
}
static
void
test_MFCreateAsyncResult
(
void
)
...
...
@@ -3114,6 +3118,19 @@ static void test_event_queue(void)
IMFMediaEventQueue_Release
(
queue
);
/* Release while subscribed. */
init_test_callback
(
&
callback
);
hr
=
MFCreateEventQueue
(
&
queue
);
ok
(
hr
==
S_OK
,
"Failed to create event queue, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEventQueue_BeginGetEvent
(
queue
,
&
callback
.
IMFAsyncCallback_iface
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed to Begin*, hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
&
callback
.
IMFAsyncCallback_iface
,
2
);
IMFMediaEventQueue_Release
(
queue
);
EXPECT_REF
(
&
callback
.
IMFAsyncCallback_iface
,
1
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
}
...
...
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