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
bd6f6bc2
Commit
bd6f6bc2
authored
Jan 10, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Jan 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Prevent deadlock when releasing a stream that's still playing.
parent
436d26f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
audio.c
dlls/mmdevapi/audio.c
+3
-0
render.c
dlls/mmdevapi/tests/render.c
+47
-0
No files found.
dlls/mmdevapi/audio.c
View file @
bd6f6bc2
...
...
@@ -313,7 +313,10 @@ HRESULT AudioClient_Create(MMDevice *parent, IAudioClient **ppv)
static
void
AudioClient_Destroy
(
ACImpl
*
This
)
{
if
(
This
->
timer_id
)
{
DeleteTimerQueueTimer
(
NULL
,
This
->
timer_id
,
INVALID_HANDLE_VALUE
);
This
->
timer_id
=
0
;
}
if
(
This
->
render
)
AudioRenderClient_Destroy
(
This
->
render
);
if
(
This
->
capture
)
...
...
dlls/mmdevapi/tests/render.c
View file @
bd6f6bc2
...
...
@@ -334,6 +334,52 @@ static void test_references(void)
ok
(
ref
==
0
,
"AudioClock_Release gave wrong refcount: %u
\n
"
,
ref
);
}
static
void
test_event
(
void
)
{
HANDLE
event
;
HRESULT
hr
;
IAudioClient
*
ac
;
WAVEFORMATEX
*
pwfx
;
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
ac
);
ok
(
hr
==
S_OK
,
"Activation failed with %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IAudioClient_GetMixFormat
(
ac
,
&
pwfx
);
ok
(
hr
==
S_OK
,
"GetMixFormat failed: %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IAudioClient_Initialize
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
,
5000000
,
0
,
pwfx
,
NULL
);
ok
(
hr
==
S_OK
,
"Initialize failed: %08x
\n
"
,
hr
);
event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
event
!=
NULL
,
"CreateEvent failed
\n
"
);
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
AUDCLNT_E_EVENTHANDLE_NOT_SET
,
"Start failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
event
);
ok
(
hr
==
S_OK
,
"SetEventHandle failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_Stop
(
ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
/* test releasing a playing stream */
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
IAudioClient_Release
(
ac
);
CloseHandle
(
event
);
}
START_TEST
(
render
)
{
HRESULT
hr
;
...
...
@@ -360,6 +406,7 @@ START_TEST(render)
test_audioclient
();
test_references
();
test_event
();
IMMDevice_Release
(
dev
);
...
...
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