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
f94114a8
Commit
f94114a8
authored
Jul 12, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Jul 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Make sure secondary_remainder and buflen are aligned to primary buffer in mixer.
parent
16e9c359
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
mixer.c
dlls/dsound/mixer.c
+3
-2
No files found.
dlls/dsound/mixer.c
View file @
f94114a8
...
...
@@ -432,6 +432,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
int
secondary_remainder
=
dsb
->
buflen
-
dsb
->
buf_mixpos
;
int
adjusted_remainder
=
MulDiv
(
dsb
->
device
->
pwfx
->
nAvgBytesPerSec
,
secondary_remainder
,
dsb
->
nAvgBytesPerSec
);
assert
(
adjusted_remainder
>=
0
);
adjusted_remainder
-=
adjusted_remainder
%
dsb
->
device
->
pwfx
->
nBlockAlign
;
/* data alignment */
/* The adjusted remainder must be at least one sample,
* otherwise we will never reach the end of the
* secondary buffer, as there will perpetually be a
...
...
@@ -588,7 +589,7 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri
{
/* The buffer's primary_mixpos may be before or after the the device
* buffer's mixpos, but both must be ahead of writepos. */
DWORD
primary_done
;
DWORD
primary_done
,
buflen
=
dsb
->
buflen
/
dsb
->
pwfx
->
nBlockAlign
*
dsb
->
device
->
pwfx
->
nBlockAlign
;
TRACE
(
"(%p,%d,%d,%d)
\n
"
,
dsb
,
playpos
,
writepos
,
mixlen
);
TRACE
(
"writepos=%d, buf_mixpos=%d, primary_mixpos=%d, mixlen=%d
\n
"
,
writepos
,
dsb
->
buf_mixpos
,
dsb
->
primary_mixpos
,
mixlen
);
...
...
@@ -611,7 +612,7 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri
TRACE
(
"mixlen (primary) = %i
\n
"
,
mixlen
);
/* clip to valid length */
mixlen
=
(
dsb
->
buflen
<
mixlen
)
?
dsb
->
buflen
:
mixlen
;
mixlen
=
(
buflen
<
mixlen
)
?
buflen
:
mixlen
;
TRACE
(
"primary_done=%d, mixlen (buffer)=%d
\n
"
,
primary_done
,
mixlen
);
...
...
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