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
47f55d6a
Commit
47f55d6a
authored
Jan 24, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Jan 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow other threads to access the primary buffer while the
format is being changed.
parent
e4a19500
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
primary.c
dlls/dsound/primary.c
+8
-9
No files found.
dlls/dsound/primary.c
View file @
47f55d6a
...
...
@@ -347,6 +347,7 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
/* **** */
RtlAcquireResourceExclusive
(
&
(
dsound
->
buffer_list_lock
),
TRUE
);
EnterCriticalSection
(
&
(
dsound
->
mixlock
));
if
(
wfex
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
alloc_size
=
sizeof
(
WAVEFORMATEX
);
...
...
@@ -374,14 +375,12 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
if
(
err
==
DS_OK
)
{
err
=
DSOUND_PrimaryOpen
(
dsound
);
if
(
err
!=
DS_OK
)
{
WARN
(
"DSOUND_PrimaryOpen failed
\n
"
);
RtlReleaseResource
(
&
(
dsound
->
buffer_list_lock
));
return
err
;
WARN
(
"DSOUND_PrimaryOpen failed
\n
"
);
goto
done
;
}
}
else
{
WARN
(
"waveOutOpen failed
\n
"
);
RtlReleaseResource
(
&
(
dsound
->
buffer_list_lock
));
return
err
;
goto
done
;
}
}
else
if
(
dsound
->
hwbuf
)
{
err
=
IDsDriverBuffer_SetFormat
(
dsound
->
hwbuf
,
dsound
->
pwfx
);
...
...
@@ -394,15 +393,13 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
(
LPVOID
)
&
(
dsound
->
hwbuf
));
if
(
err
!=
DS_OK
)
{
WARN
(
"IDsDriver_CreateSoundBuffer failed
\n
"
);
RtlReleaseResource
(
&
(
dsound
->
buffer_list_lock
));
return
err
;
goto
done
;
}
if
(
dsound
->
state
==
STATE_PLAYING
)
dsound
->
state
=
STATE_STARTING
;
else
if
(
dsound
->
state
==
STATE_STOPPING
)
dsound
->
state
=
STATE_STOPPED
;
}
else
{
WARN
(
"IDsDriverBuffer_SetFormat failed
\n
"
);
RtlReleaseResource
(
&
(
dsound
->
buffer_list_lock
));
return
err
;
goto
done
;
}
/* FIXME: should we set err back to DS_OK in all cases ? */
}
...
...
@@ -422,6 +419,8 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
}
}
done:
LeaveCriticalSection
(
&
(
dsound
->
mixlock
));
RtlReleaseResource
(
&
(
dsound
->
buffer_list_lock
));
/* **** */
...
...
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