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
b950b9a8
Commit
b950b9a8
authored
Jun 27, 2014
by
Andrew Eikum
Committed by
Alexandre Julliard
Jun 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Don't stop sending event signals after IAudioClient::Stop.
parent
d5b597fe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
59 deletions
+54
-59
capture.c
dlls/mmdevapi/tests/capture.c
+3
-3
render.c
dlls/mmdevapi/tests/render.c
+3
-3
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+19
-21
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+11
-16
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+18
-16
No files found.
dlls/mmdevapi/tests/capture.c
View file @
b950b9a8
...
...
@@ -424,7 +424,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
/* Still receiving events! */
r
=
WaitForSingleObject
(
handle
,
20
);
todo_wine
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Stop gave %x
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Stop gave %x
\n
"
,
r
);
hr
=
IAudioClient_Reset
(
ac
);
ok
(
hr
==
S_OK
,
"Reset failed: %08x
\n
"
,
hr
);
...
...
@@ -432,13 +432,13 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
ok
(
ResetEvent
(
handle
),
"ResetEvent
\n
"
);
r
=
WaitForSingleObject
(
handle
,
120
);
todo_wine
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Reset gave %x
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Reset gave %x
\n
"
,
r
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"SetEventHandle(NULL) returns %08x
\n
"
,
hr
);
r
=
WaitForSingleObject
(
handle
,
70
);
todo_wine
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(NULL event) gave %x
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(NULL event) gave %x
\n
"
,
r
);
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
...
...
dlls/mmdevapi/tests/render.c
View file @
b950b9a8
...
...
@@ -651,7 +651,7 @@ static void test_event(void)
/* Still receiving events! */
r
=
WaitForSingleObject
(
event
,
20
);
todo_wine
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Stop gave %x
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Stop gave %x
\n
"
,
r
);
hr
=
IAudioClient_Reset
(
ac
);
ok
(
hr
==
S_OK
,
"Reset failed: %08x
\n
"
,
hr
);
...
...
@@ -659,13 +659,13 @@ static void test_event(void)
ok
(
ResetEvent
(
event
),
"ResetEvent
\n
"
);
r
=
WaitForSingleObject
(
event
,
120
);
todo_wine
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Reset gave %x
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Reset gave %x
\n
"
,
r
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"SetEventHandle(NULL) returns %08x
\n
"
,
hr
);
r
=
WaitForSingleObject
(
event
,
70
);
todo_wine
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(NULL event) gave %x
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(NULL event) gave %x
\n
"
,
r
);
/* test releasing a playing stream */
hr
=
IAudioClient_Start
(
ac
);
...
...
dlls/winealsa.drv/mmdevdrv.c
View file @
b950b9a8
...
...
@@ -889,9 +889,21 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
{
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) Refcount now %u
\n
"
,
This
,
ref
);
if
(
!
ref
){
if
(
This
->
timer
){
HANDLE
event
;
DWORD
wait
;
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
}
IAudioClient_Stop
(
iface
);
IMMDevice_Release
(
This
->
parent
);
IUnknown_Release
(
This
->
pUnkFTMarshal
);
...
...
@@ -2191,11 +2203,13 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
This
->
bufsize_frames
);
}
if
(
!
CreateTimerQueueTimer
(
&
This
->
timer
,
g_timer_q
,
alsa_push_buffer_data
,
This
,
0
,
This
->
mmdev_period_rt
/
10000
,
WT_EXECUTEINTIMERTHREAD
)){
LeaveCriticalSection
(
&
This
->
lock
);
WARN
(
"Unable to create timer: %u
\n
"
,
GetLastError
());
return
E_OUTOFMEMORY
;
if
(
!
This
->
timer
){
if
(
!
CreateTimerQueueTimer
(
&
This
->
timer
,
g_timer_q
,
alsa_push_buffer_data
,
This
,
0
,
This
->
mmdev_period_rt
/
10000
,
WT_EXECUTEINTIMERTHREAD
)){
LeaveCriticalSection
(
&
This
->
lock
);
WARN
(
"Unable to create timer: %u
\n
"
,
GetLastError
());
return
E_OUTOFMEMORY
;
}
}
This
->
started
=
TRUE
;
...
...
@@ -2208,8 +2222,6 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
static
HRESULT
WINAPI
AudioClient_Stop
(
IAudioClient
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
HANDLE
event
;
BOOL
wait
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -2225,24 +2237,10 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return
S_FALSE
;
}
/* Stop without losing written frames or position.
* snd_pcm_pause would be appropriate but is unsupported by dmix.
* snd_pcm_drain yields EAGAIN in NONBLOCK mode, except with Pulse. */
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
if
(
wait
)
WARN
(
"DeleteTimerQueueTimer error %u
\n
"
,
GetLastError
());
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
This
->
started
=
FALSE
;
LeaveCriticalSection
(
&
This
->
lock
);
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
return
S_OK
;
}
...
...
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
b950b9a8
...
...
@@ -827,6 +827,16 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) Refcount now %u
\n
"
,
This
,
ref
);
if
(
!
ref
){
if
(
This
->
timer
){
HANDLE
event
;
BOOL
wait
;
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
}
if
(
This
->
aqueue
){
AQBuffer
*
buf
,
*
next
;
QueuedBufInfo
*
bufinfo
,
*
bufinfo2
;
...
...
@@ -1706,7 +1716,7 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return
AUDCLNT_E_EVENTHANDLE_NOT_SET
;
}
if
(
This
->
event
)
if
(
This
->
event
&&
!
This
->
timer
)
if
(
!
CreateTimerQueueTimer
(
&
This
->
timer
,
g_timer_q
,
ca_period_cb
,
This
,
0
,
This
->
period_ms
,
WT_EXECUTEINTIMERTHREAD
)){
This
->
timer
=
NULL
;
...
...
@@ -1739,8 +1749,6 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
AudioTimeStamp
tstamp
;
OSStatus
sc
;
HANDLE
event
=
NULL
;
BOOL
wait
=
FALSE
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1761,15 +1769,6 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return
S_OK
;
}
if
(
This
->
timer
){
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
This
->
timer
=
NULL
;
if
(
wait
)
WARN
(
"DeleteTimerQueueTimer error %u
\n
"
,
GetLastError
());
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
}
This
->
playing
=
StateInTransition
;
sc
=
AudioQueueGetCurrentTime
(
This
->
aqueue
,
NULL
,
&
tstamp
,
NULL
);
...
...
@@ -1794,10 +1793,6 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
OSSpinLockUnlock
(
&
This
->
lock
);
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
return
S_OK
;
}
...
...
dlls/wineoss.drv/mmdevdrv.c
View file @
b950b9a8
...
...
@@ -712,9 +712,21 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
{
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) Refcount now %u
\n
"
,
This
,
ref
);
if
(
!
ref
){
if
(
This
->
timer
){
HANDLE
event
;
DWORD
wait
;
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
}
IAudioClient_Stop
(
iface
);
IMMDevice_Release
(
This
->
parent
);
IUnknown_Release
(
This
->
pUnkFTMarshal
);
...
...
@@ -1542,10 +1554,12 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return
AUDCLNT_E_NOT_STOPPED
;
}
if
(
!
CreateTimerQueueTimer
(
&
This
->
timer
,
g_timer_q
,
oss_period_callback
,
This
,
0
,
This
->
period_us
/
1000
,
WT_EXECUTEINTIMERTHREAD
))
ERR
(
"Unable to create period timer: %u
\n
"
,
GetLastError
());
if
(
!
This
->
timer
){
if
(
!
CreateTimerQueueTimer
(
&
This
->
timer
,
g_timer_q
,
oss_period_callback
,
This
,
0
,
This
->
period_us
/
1000
,
WT_EXECUTEINTIMERTHREAD
))
ERR
(
"Unable to create period timer: %u
\n
"
,
GetLastError
());
}
This
->
playing
=
TRUE
;
...
...
@@ -1557,8 +1571,6 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
static
HRESULT
WINAPI
AudioClient_Stop
(
IAudioClient
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
HANDLE
event
;
DWORD
wait
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1574,20 +1586,10 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return
S_FALSE
;
}
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
if
(
wait
)
WARN
(
"DeleteTimerQueueTimer error %u
\n
"
,
GetLastError
());
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
This
->
playing
=
FALSE
;
LeaveCriticalSection
(
&
This
->
lock
);
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
return
S_OK
;
}
...
...
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