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
221a0cdb
Commit
221a0cdb
authored
Jul 02, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/dsoundrender: Use flush_event instead of reimplementing it.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
436fb03a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
36 deletions
+3
-36
dsoundrender.c
dlls/quartz/dsoundrender.c
+3
-36
No files found.
dlls/quartz/dsoundrender.c
View file @
221a0cdb
...
...
@@ -64,8 +64,6 @@ typedef struct DSoundRenderImpl
REFERENCE_TIME
play_time
;
HANDLE
blocked
;
LONG
volume
;
LONG
pan
;
...
...
@@ -245,7 +243,7 @@ static HRESULT DSoundRender_HandleEndOfStream(DSoundRenderImpl *This)
This
->
in_loop
=
1
;
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
LeaveCriticalSection
(
&
This
->
renderer
.
csRenderLock
);
WaitForSingleObject
(
This
->
blocked
,
10
);
WaitForSingleObject
(
This
->
renderer
.
flush_event
,
10
);
EnterCriticalSection
(
&
This
->
renderer
.
csRenderLock
);
EnterCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
This
->
in_loop
=
0
;
...
...
@@ -270,7 +268,7 @@ static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, REFERENCE_TIM
if
(
hr
!=
S_OK
)
{
This
->
in_loop
=
1
;
LeaveCriticalSection
(
&
This
->
renderer
.
csRenderLock
);
ret
=
WaitForSingleObject
(
This
->
blocked
,
10
);
ret
=
WaitForSingleObject
(
This
->
renderer
.
flush_event
,
10
);
EnterCriticalSection
(
&
This
->
renderer
.
csRenderLock
);
This
->
in_loop
=
0
;
if
(
This
->
renderer
.
sink
.
flushing
||
This
->
renderer
.
filter
.
state
==
State_Stopped
)
...
...
@@ -434,7 +432,6 @@ static VOID WINAPI DSoundRender_OnStopStreaming(BaseRenderer * iface)
IDirectSoundBuffer_Stop
(
This
->
dsbuffer
);
This
->
writepos
=
This
->
buf_size
;
SetEvent
(
This
->
blocked
);
}
static
VOID
WINAPI
DSoundRender_OnStartStreaming
(
BaseRenderer
*
iface
)
...
...
@@ -445,13 +442,7 @@ static VOID WINAPI DSoundRender_OnStartStreaming(BaseRenderer * iface)
if
(
This
->
renderer
.
sink
.
pin
.
pConnectedTo
)
{
if
(
This
->
renderer
.
filter
.
state
==
State_Paused
)
{
/* Unblock our thread, state changing from paused to running doesn't need a reset for state change */
SetEvent
(
This
->
blocked
);
}
IDirectSoundBuffer_Play
(
This
->
dsbuffer
,
0
,
0
,
DSBPLAY_LOOPING
);
ResetEvent
(
This
->
blocked
);
}
}
...
...
@@ -548,17 +539,6 @@ static HRESULT WINAPI DSoundRender_EndOfStream(BaseRenderer* iface)
return
hr
;
}
static
HRESULT
WINAPI
DSoundRender_BeginFlush
(
BaseRenderer
*
iface
)
{
DSoundRenderImpl
*
This
=
impl_from_BaseRenderer
(
iface
);
TRACE
(
"
\n
"
);
BaseRendererImpl_BeginFlush
(
iface
);
SetEvent
(
This
->
blocked
);
return
S_OK
;
}
static
HRESULT
WINAPI
DSoundRender_EndFlush
(
BaseRenderer
*
iface
)
{
DSoundRenderImpl
*
This
=
impl_from_BaseRenderer
(
iface
);
...
...
@@ -566,8 +546,6 @@ static HRESULT WINAPI DSoundRender_EndFlush(BaseRenderer* iface)
TRACE
(
"
\n
"
);
BaseRendererImpl_EndFlush
(
iface
);
if
(
This
->
renderer
.
filter
.
state
!=
State_Stopped
)
ResetEvent
(
This
->
blocked
);
if
(
This
->
dsbuffer
)
{
...
...
@@ -602,8 +580,6 @@ static void dsound_render_destroy(BaseRenderer *iface)
IDirectSound8_Release
(
filter
->
dsound
);
filter
->
dsound
=
NULL
;
CloseHandle
(
filter
->
blocked
);
strmbase_renderer_cleanup
(
&
filter
->
renderer
);
CoTaskMemFree
(
filter
);
}
...
...
@@ -643,7 +619,7 @@ static const BaseRendererFuncTable BaseFuncTable = {
DSoundRender_CompleteConnect
,
DSoundRender_BreakConnect
,
DSoundRender_EndOfStream
,
DSoundRender_BeginFlush
,
NULL
,
DSoundRender_EndFlush
,
dsound_render_destroy
,
dsound_render_query_interface
,
...
...
@@ -695,14 +671,6 @@ HRESULT DSoundRender_create(IUnknown *outer, void **out)
if
(
SUCCEEDED
(
hr
))
{
pDSoundRender
->
blocked
=
CreateEventW
(
NULL
,
TRUE
,
TRUE
,
NULL
);
if
(
!
pDSoundRender
->
blocked
||
FAILED
(
hr
))
{
IBaseFilter_Release
(
&
pDSoundRender
->
renderer
.
filter
.
IBaseFilter_iface
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
*
out
=
&
pDSoundRender
->
renderer
.
filter
.
IUnknown_inner
;
}
else
...
...
@@ -735,7 +703,6 @@ static HRESULT WINAPI DSoundRender_Pause(IBaseFilter * iface)
if
(
SUCCEEDED
(
hr
))
This
->
renderer
.
filter
.
state
=
State_Paused
;
ResetEvent
(
This
->
blocked
);
ResetEvent
(
This
->
renderer
.
flush_event
);
}
LeaveCriticalSection
(
&
This
->
renderer
.
csRenderLock
);
...
...
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