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
8a1d4d1e
Commit
8a1d4d1e
authored
Mar 27, 2007
by
Chris Robinson
Committed by
Alexandre Julliard
Mar 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Protect DSound buffer creation with a critical section lock.
parent
dab3825b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
dsoundrender.c
dlls/quartz/dsoundrender.c
+16
-5
No files found.
dlls/quartz/dsoundrender.c
View file @
8a1d4d1e
...
@@ -132,11 +132,20 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
...
@@ -132,11 +132,20 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
TRACE
(
"nBlockAlign = %d
\n
"
,
format
->
nBlockAlign
);
TRACE
(
"nBlockAlign = %d
\n
"
,
format
->
nBlockAlign
);
TRACE
(
"wBitsPerSample = %d
\n
"
,
format
->
wBitsPerSample
);
TRACE
(
"wBitsPerSample = %d
\n
"
,
format
->
wBitsPerSample
);
TRACE
(
"cbSize = %d
\n
"
,
format
->
cbSize
);
TRACE
(
"cbSize = %d
\n
"
,
format
->
cbSize
);
/* Lock the critical section to make sure we're still marked to play while
setting up the playback buffer */
EnterCriticalSection
(
&
This
->
csFilter
);
if
(
This
->
state
!=
State_Running
)
{
hr
=
VFW_E_WRONG_STATE
;
goto
getout
;
}
hr
=
DirectSoundCreate
(
NULL
,
&
This
->
dsound
,
NULL
);
hr
=
DirectSoundCreate
(
NULL
,
&
This
->
dsound
,
NULL
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
{
ERR
(
"Cannot create Direct Sound object
\n
"
);
ERR
(
"Cannot create Direct Sound object
\n
"
);
return
hr
;
goto
getout
;
}
}
wav_fmt
=
*
format
;
wav_fmt
=
*
format
;
...
@@ -151,7 +160,7 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
...
@@ -151,7 +160,7 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
{
ERR
(
"Can't create sound buffer !
\n
"
);
ERR
(
"Can't create sound buffer !
\n
"
);
IDirectSound_Release
(
This
->
dsound
);
IDirectSound_Release
(
This
->
dsound
);
return
hr
;
goto
getout
;
}
}
hr
=
IDirectSoundBuffer_SetVolume
(
This
->
dsbuffer
,
This
->
volume
);
hr
=
IDirectSoundBuffer_SetVolume
(
This
->
dsbuffer
,
This
->
volume
);
...
@@ -167,11 +176,13 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
...
@@ -167,11 +176,13 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
ERR
(
"Can't start sound buffer (%x)!
\n
"
,
hr
);
ERR
(
"Can't start sound buffer (%x)!
\n
"
,
hr
);
IDirectSoundBuffer_Release
(
This
->
dsbuffer
);
IDirectSoundBuffer_Release
(
This
->
dsbuffer
);
IDirectSound_Release
(
This
->
dsound
);
IDirectSound_Release
(
This
->
dsound
);
return
hr
;
goto
getout
;
}
}
This
->
write_pos
=
0
;
This
->
write_pos
=
0
;
getout:
LeaveCriticalSection
(
&
This
->
csFilter
);
return
hr
;
return
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