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
c5003854
Commit
c5003854
authored
Feb 16, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Feb 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some block align cleanups.
parent
3988d9c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
mixer.c
dlls/dsound/mixer.c
+2
-2
primary.c
dlls/dsound/primary.c
+6
-6
No files found.
dlls/dsound/mixer.c
View file @
c5003854
...
...
@@ -388,7 +388,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
len
=
min
(
len
,
temp
);
}
nBlockAlign
=
dsb
->
dsound
->
pwfx
->
nBlockAlign
;
len
=
len
/
nBlockAlign
*
nBlockAlign
;
/* data alignment */
len
=
(
len
/
nBlockAlign
)
*
nBlockAlign
;
/* data alignment */
if
(
len
==
0
)
{
/* This should only happen if we aren't looping and temp < nBlockAlign */
...
...
@@ -502,7 +502,7 @@ static void DSOUND_PhaseCancel(IDirectSoundBufferImpl *dsb, DWORD writepos, DWOR
TRACE
(
"(%p,%ld,%ld)
\n
"
,
dsb
,
writepos
,
len
);
nBlockAlign
=
dsb
->
dsound
->
pwfx
->
nBlockAlign
;
len
=
len
/
nBlockAlign
*
nBlockAlign
;
/* data alignment */
len
=
(
len
/
nBlockAlign
)
*
nBlockAlign
;
/* data alignment */
if
((
buf
=
ibuf
=
DSOUND_tmpbuffer
(
dsb
->
dsound
,
len
))
==
NULL
)
return
;
...
...
dlls/dsound/primary.c
View file @
c5003854
...
...
@@ -38,22 +38,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
void
DSOUND_RecalcPrimary
(
IDirectSoundImpl
*
This
)
{
DWORD
sw
;
DWORD
nBlockAlign
;
TRACE
(
"(%p)
\n
"
,
This
);
sw
=
This
->
pwfx
->
nChannels
*
(
This
->
pwfx
->
wBitsPerSample
/
8
)
;
nBlockAlign
=
This
->
pwfx
->
nBlockAlign
;
if
(
This
->
hwbuf
)
{
DWORD
fraglen
;
/* let fragment size approximate the timer delay */
fraglen
=
(
This
->
pwfx
->
nSamplesPerSec
*
DS_TIME_DEL
/
1000
)
*
sw
;
fraglen
=
(
This
->
pwfx
->
nSamplesPerSec
*
DS_TIME_DEL
/
1000
)
*
nBlockAlign
;
/* reduce fragment size until an integer number of them fits in the buffer */
/* (FIXME: this may or may not be a good idea) */
while
(
This
->
buflen
%
fraglen
)
fraglen
-=
sw
;
while
(
This
->
buflen
%
fraglen
)
fraglen
-=
nBlockAlign
;
This
->
fraglen
=
fraglen
;
TRACE
(
"fraglen=%ld
\n
"
,
This
->
fraglen
);
}
/* calculate the 10ms write lead */
This
->
writelead
=
(
This
->
pwfx
->
nSamplesPerSec
/
100
)
*
sw
;
This
->
writelead
=
(
This
->
pwfx
->
nSamplesPerSec
/
100
)
*
nBlockAlign
;
}
static
HRESULT
DSOUND_PrimaryOpen
(
IDirectSoundImpl
*
This
)
...
...
@@ -72,7 +72,7 @@ static HRESULT DSOUND_PrimaryOpen(IDirectSoundImpl *This)
else
if
(
This
->
state
==
STATE_STOPPING
)
This
->
state
=
STATE_STOPPED
;
/* use fragments of 10ms (1/100s) each (which should get us within
* the documented write cursor lead of 10-15ms) */
buflen
=
((
This
->
pwfx
->
n
AvgBytesPerSec
/
100
)
&
~
3
)
*
DS_HEL_FRAGS
;
buflen
=
((
This
->
pwfx
->
n
SamplesPerSec
/
100
)
*
This
->
pwfx
->
nBlockAlign
)
*
DS_HEL_FRAGS
;
TRACE
(
"desired buflen=%ld, old buffer=%p
\n
"
,
buflen
,
This
->
buffer
);
/* reallocate emulated primary buffer */
...
...
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