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
848fe4a7
Commit
848fe4a7
authored
Aug 08, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Create the test_callback event in the constructor.
parent
cda2886f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
17 deletions
+4
-17
mfplat.c
dlls/mfplat/tests/mfplat.c
+4
-17
No files found.
dlls/mfplat/tests/mfplat.c
View file @
848fe4a7
...
...
@@ -521,7 +521,10 @@ static ULONG WINAPI testcallback_Release(IMFAsyncCallback *iface)
ULONG
refcount
=
InterlockedDecrement
(
&
callback
->
refcount
);
if
(
!
refcount
)
{
CloseHandle
(
callback
->
event
);
free
(
callback
);
}
return
refcount
;
}
...
...
@@ -804,6 +807,7 @@ static struct test_callback * create_test_callback(const IMFAsyncCallbackVtbl *v
callback
->
IMFAsyncCallback_iface
.
lpVtbl
=
vtbl
?
vtbl
:
&
testcallbackvtbl
;
callback
->
refcount
=
1
;
callback
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
return
callback
;
}
...
...
@@ -816,7 +820,6 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected
HRESULT
hr
;
callback
=
create_test_callback
(
&
events_callback_vtbl
);
callback
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
for
(;;)
{
...
...
@@ -847,7 +850,6 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected
}
}
CloseHandle
(
callback
->
event
);
if
(
callback
->
media_event
)
IMFMediaEvent_Release
(
callback
->
media_event
);
IMFAsyncCallback_Release
(
&
callback
->
IMFAsyncCallback_iface
);
...
...
@@ -937,7 +939,6 @@ static void test_source_resolver(void)
IMFByteStream_Release
(
stream
);
/* Create from URL. */
callback
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
hr
=
IMFSourceResolver_CreateObjectFromURL
(
resolver
,
L"nonexisting.mp4"
,
MF_RESOLUTION_BYTESTREAM
,
NULL
,
&
obj_type
,
(
IUnknown
**
)
&
stream
);
...
...
@@ -1234,7 +1235,6 @@ static void test_source_resolver(void)
(
void
**
)
&
scheme_handler
);
ok
(
hr
==
S_OK
,
"Failed to create handler object, hr %#lx.
\n
"
,
hr
);
callback2
->
event
=
callback
->
event
;
cancel_cookie
=
NULL
;
hr
=
IMFSchemeHandler_BeginCreateObject
(
scheme_handler
,
pathW
,
MF_RESOLUTION_MEDIASOURCE
,
NULL
,
&
cancel_cookie
,
&
callback2
->
IMFAsyncCallback_iface
,
(
IUnknown
*
)
scheme_handler
);
...
...
@@ -1249,8 +1249,6 @@ static void test_source_resolver(void)
if
(
do_uninit
)
CoUninitialize
();
CloseHandle
(
callback
->
event
);
IMFSourceResolver_Release
(
resolver
);
hr
=
MFShutdown
();
...
...
@@ -3524,16 +3522,12 @@ static void test_event_queue(void)
hr
=
IMFMediaEventQueue_BeginGetEvent
(
queue
,
&
callback2
->
IMFAsyncCallback_iface
,
(
IUnknown
*
)
&
callback
->
IMFAsyncCallback_iface
);
ok
(
hr
==
MF_E_MULTIPLE_SUBSCRIBERS
,
"Unexpected hr %#lx.
\n
"
,
hr
);
callback
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
hr
=
IMFMediaEventQueue_QueueEvent
(
queue
,
event
);
ok
(
hr
==
S_OK
,
"Failed to queue event, hr %#lx.
\n
"
,
hr
);
ret
=
WaitForSingleObject
(
callback
->
event
,
500
);
ok
(
ret
==
WAIT_OBJECT_0
,
"Unexpected return value %#lx.
\n
"
,
ret
);
CloseHandle
(
callback
->
event
);
IMFMediaEvent_Release
(
event
);
hr
=
MFCreateAsyncResult
(
NULL
,
&
callback
->
IMFAsyncCallback_iface
,
NULL
,
&
result
);
...
...
@@ -4957,8 +4951,6 @@ static void test_async_create_file(void)
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Fail to start up, hr %#lx.
\n
"
,
hr
);
callback
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
GetTempPathW
(
ARRAY_SIZE
(
pathW
),
pathW
);
GetTempFileNameW
(
pathW
,
NULL
,
0
,
fileW
);
...
...
@@ -4971,8 +4963,6 @@ static void test_async_create_file(void)
IUnknown_Release
(
cancel_cookie
);
CloseHandle
(
callback
->
event
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#lx.
\n
"
,
hr
);
...
...
@@ -5856,7 +5846,6 @@ static void test_queue_com_state(const char *name)
HRESULT
hr
;
callback
=
create_test_callback
(
&
test_queue_com_state_callback_vtbl
);
callback
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#lx.
\n
"
,
hr
);
...
...
@@ -5888,8 +5877,6 @@ static void test_queue_com_state(const char *name)
}
}
CloseHandle
(
callback
->
event
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#lx.
\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