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
af5423ef
Commit
af5423ef
authored
Feb 11, 2011
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Feb 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Forcibly lock buffers to be mixed.
parent
43790cf3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
mixer.c
dlls/dsound/mixer.c
+3
-15
No files found.
dlls/dsound/mixer.c
View file @
af5423ef
...
...
@@ -664,7 +664,6 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi
* writepos = the current safe-to-write position in the primary buffer
* mixlen = the maximum amount to mix into the primary buffer
* (beyond the current writepos)
* mustlock = Do we have to fight for lock because we otherwise risk an underrun?
* recover = true if the sound device may have been reset and the write
* position in the device buffer changed
* all_stopped = reports back if all buffers have stopped
...
...
@@ -672,12 +671,11 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi
* Returns: the length beyond the writepos that was mixed to.
*/
static
DWORD
DSOUND_MixToPrimary
(
const
DirectSoundDevice
*
device
,
DWORD
writepos
,
DWORD
mixlen
,
BOOL
mustlock
,
BOOL
recover
,
BOOL
*
all_stopped
)
static
DWORD
DSOUND_MixToPrimary
(
const
DirectSoundDevice
*
device
,
DWORD
writepos
,
DWORD
mixlen
,
BOOL
recover
,
BOOL
*
all_stopped
)
{
INT
i
,
len
;
DWORD
minlen
=
0
;
IDirectSoundBufferImpl
*
dsb
;
BOOL
gotall
=
TRUE
;
/* unless we find a running buffer, all have stopped */
*
all_stopped
=
TRUE
;
...
...
@@ -690,11 +688,7 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos
if
(
dsb
->
buflen
&&
dsb
->
state
&&
!
dsb
->
hwbuf
)
{
TRACE
(
"Checking %p, mixlen=%d
\n
"
,
dsb
,
mixlen
);
if
(
!
RtlAcquireResourceShared
(
&
dsb
->
lock
,
mustlock
))
{
gotall
=
FALSE
;
continue
;
}
RtlAcquireResourceShared
(
&
dsb
->
lock
,
TRUE
);
/* if buffer is stopping it is stopped now */
if
(
dsb
->
state
==
STATE_STOPPING
)
{
dsb
->
state
=
STATE_STOPPED
;
...
...
@@ -726,7 +720,6 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos
}
TRACE
(
"Mixed at least %d from all buffers
\n
"
,
minlen
);
if
(
!
gotall
)
return
0
;
return
minlen
;
}
...
...
@@ -814,7 +807,6 @@ static void DSOUND_PerformMix(DirectSoundDevice *device)
DWORD
playpos
,
writepos
,
writelead
,
maxq
,
frag
,
prebuff_max
,
prebuff_left
,
size1
,
size2
,
mixplaypos
,
mixplaypos2
;
LPVOID
buf1
,
buf2
;
BOOL
lock
=
(
device
->
hwbuf
&&
!
(
device
->
drvdesc
.
dwFlags
&
DSDDESC_DONTNEEDPRIMARYLOCK
));
BOOL
mustlock
=
FALSE
;
int
nfiller
;
/* the sound of silence */
...
...
@@ -897,15 +889,11 @@ static void DSOUND_PerformMix(DirectSoundDevice *device)
TRACE
(
"prebuff_left = %d, prebuff_max = %dx%d=%d, writelead=%d
\n
"
,
prebuff_left
,
device
->
prebuf
,
device
->
fraglen
,
prebuff_max
,
writelead
);
/* Do we risk an 'underrun' if we don't advance pointer? */
if
(
writelead
/
device
->
fraglen
<=
ds_snd_queue_min
||
recover
)
mustlock
=
TRUE
;
if
(
lock
)
IDsDriverBuffer_Lock
(
device
->
hwbuf
,
&
buf1
,
&
size1
,
&
buf2
,
&
size2
,
writepos
,
maxq
,
0
);
/* do the mixing */
frag
=
DSOUND_MixToPrimary
(
device
,
writepos
,
maxq
,
mustlock
,
recover
,
&
all_stopped
);
frag
=
DSOUND_MixToPrimary
(
device
,
writepos
,
maxq
,
recover
,
&
all_stopped
);
if
(
frag
+
writepos
>
device
->
buflen
)
{
...
...
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