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
2a052044
Commit
2a052044
authored
Feb 25, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Feb 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use nBlockAlign rather than calculating it.
Add a buffer length alignment error message.
parent
0fb9ef68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
mixer.c
dlls/dsound/mixer.c
+14
-9
No files found.
dlls/dsound/mixer.c
View file @
2a052044
...
@@ -91,12 +91,10 @@ void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan)
...
@@ -91,12 +91,10 @@ void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan)
void
DSOUND_RecalcFormat
(
IDirectSoundBufferImpl
*
dsb
)
void
DSOUND_RecalcFormat
(
IDirectSoundBufferImpl
*
dsb
)
{
{
DWORD
sw
;
TRACE
(
"(%p)
\n
"
,
dsb
);
TRACE
(
"(%p)
\n
"
,
dsb
);
sw
=
dsb
->
pwfx
->
nChannels
*
(
dsb
->
pwfx
->
wBitsPerSample
/
8
);
/* calculate the 10ms write lead */
/* calculate the 10ms write lead */
dsb
->
writelead
=
(
dsb
->
freq
/
100
)
*
sw
;
dsb
->
writelead
=
(
dsb
->
freq
/
100
)
*
dsb
->
pwfx
->
nBlockAlign
;
}
}
void
DSOUND_CheckEvent
(
IDirectSoundBufferImpl
*
dsb
,
int
len
)
void
DSOUND_CheckEvent
(
IDirectSoundBufferImpl
*
dsb
,
int
len
)
...
@@ -374,7 +372,7 @@ static LPBYTE DSOUND_tmpbuffer(IDirectSoundImpl *dsound, DWORD len)
...
@@ -374,7 +372,7 @@ static LPBYTE DSOUND_tmpbuffer(IDirectSoundImpl *dsound, DWORD len)
static
DWORD
DSOUND_MixInBuffer
(
IDirectSoundBufferImpl
*
dsb
,
DWORD
writepos
,
DWORD
fraglen
)
static
DWORD
DSOUND_MixInBuffer
(
IDirectSoundBufferImpl
*
dsb
,
DWORD
writepos
,
DWORD
fraglen
)
{
{
INT
i
,
len
,
ilen
,
field
,
nBlockAlign
,
todo
;
INT
i
,
len
,
ilen
,
field
,
todo
;
BYTE
*
buf
,
*
ibuf
;
BYTE
*
buf
,
*
ibuf
;
TRACE
(
"(%p,%ld,%ld)
\n
"
,
dsb
,
writepos
,
fraglen
);
TRACE
(
"(%p,%ld,%ld)
\n
"
,
dsb
,
writepos
,
fraglen
);
...
@@ -387,8 +385,12 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
...
@@ -387,8 +385,12 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
dsb
->
nAvgBytesPerSec
);
dsb
->
nAvgBytesPerSec
);
len
=
min
(
len
,
temp
);
len
=
min
(
len
,
temp
);
}
}
nBlockAlign
=
dsb
->
dsound
->
pwfx
->
nBlockAlign
;
len
=
(
len
/
nBlockAlign
)
*
nBlockAlign
;
/* data alignment */
if
(
len
%
dsb
->
dsound
->
pwfx
->
nBlockAlign
)
{
INT
nBlockAlign
=
dsb
->
dsound
->
pwfx
->
nBlockAlign
;
len
=
(
len
/
nBlockAlign
)
*
nBlockAlign
;
/* data alignment */
ERR
(
"length not a multiple of block size, len = %d, block size = %d
\n
"
,
len
,
nBlockAlign
);
}
if
(
len
==
0
)
{
if
(
len
==
0
)
{
/* This should only happen if we aren't looping and temp < nBlockAlign */
/* This should only happen if we aren't looping and temp < nBlockAlign */
...
@@ -495,14 +497,17 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
...
@@ -495,14 +497,17 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
static
void
DSOUND_PhaseCancel
(
IDirectSoundBufferImpl
*
dsb
,
DWORD
writepos
,
DWORD
len
)
static
void
DSOUND_PhaseCancel
(
IDirectSoundBufferImpl
*
dsb
,
DWORD
writepos
,
DWORD
len
)
{
{
INT
ilen
,
field
,
nBlockAlign
;
INT
ilen
,
field
;
UINT
i
,
todo
;
UINT
i
,
todo
;
BYTE
*
buf
,
*
ibuf
;
BYTE
*
buf
,
*
ibuf
;
TRACE
(
"(%p,%ld,%ld)
\n
"
,
dsb
,
writepos
,
len
);
TRACE
(
"(%p,%ld,%ld)
\n
"
,
dsb
,
writepos
,
len
);
nBlockAlign
=
dsb
->
dsound
->
pwfx
->
nBlockAlign
;
if
(
len
%
dsb
->
dsound
->
pwfx
->
nBlockAlign
)
{
len
=
(
len
/
nBlockAlign
)
*
nBlockAlign
;
/* data alignment */
INT
nBlockAlign
=
dsb
->
dsound
->
pwfx
->
nBlockAlign
;
len
=
(
len
/
nBlockAlign
)
*
nBlockAlign
;
/* data alignment */
ERR
(
"length not a multiple of block size, len = %ld, block size = %d
\n
"
,
len
,
nBlockAlign
);
}
if
((
buf
=
ibuf
=
DSOUND_tmpbuffer
(
dsb
->
dsound
,
len
))
==
NULL
)
if
((
buf
=
ibuf
=
DSOUND_tmpbuffer
(
dsb
->
dsound
,
len
))
==
NULL
)
return
;
return
;
...
...
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