Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
ab4ef663
Commit
ab4ef663
authored
13 years ago
by
Alexander E. Patrakov
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dsound: Clean up cp_fields.
parent
f88f3d41
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dsound/mixer.c
+10
-13
10 additions, 13 deletions
dlls/dsound/mixer.c
with
10 additions
and
13 deletions
dlls/dsound/mixer.c
+
10
−
13
View file @
ab4ef663
...
...
@@ -269,16 +269,19 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len
}
/**
* Copy
a single
frame from the given input buffer to the given output buffer.
* Copy frame
s
from the given input buffer to the given output buffer.
* Translate 8 <-> 16 bits and mono <-> stereo
*/
static
inline
void
cp_fields
(
const
IDirectSoundBufferImpl
*
dsb
,
const
BYTE
*
ibuf
,
UINT
istride
,
UINT
ostride
,
UINT
count
,
UINT
freqAcc
,
UINT
adj
)
static
inline
void
cp_fields
(
const
IDirectSoundBufferImpl
*
dsb
,
UINT
ostride
,
UINT
count
,
UINT
freqAcc
)
{
DWORD
ipos
=
dsb
->
sec_mixpos
;
UINT
istride
=
dsb
->
pwfx
->
nBlockAlign
;
UINT
adj
=
dsb
->
freqAdjust
;
DirectSoundDevice
*
device
=
dsb
->
device
;
float
value
;
ULONG
adv
;
DWORD
ipos
=
dsb
->
sec_mixpos
,
opos
=
0
;
DWORD
opos
=
0
;
while
(
count
--
>
0
)
{
if
(
device
->
pwfx
->
nChannels
==
dsb
->
pwfx
->
nChannels
||
...
...
@@ -345,13 +348,10 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
*/
static
void
DSOUND_MixToTemporary
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
tmp_len
)
{
INT
size
;
BYTE
*
ibp
;
INT
iAdvance
=
dsb
->
pwfx
->
nBlockAlign
;
INT
oAdvance
=
dsb
->
device
->
pwfx
->
nBlockAlign
;
INT
size
=
tmp_len
/
oAdvance
;
DWORD
freqAcc
;
ibp
=
dsb
->
buffer
->
memory
+
dsb
->
sec_mixpos
;
if
(
dsb
->
device
->
tmp_buffer_len
<
tmp_len
||
!
dsb
->
device
->
tmp_buffer
)
{
dsb
->
device
->
tmp_buffer_len
=
tmp_len
;
...
...
@@ -361,15 +361,12 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_l
dsb
->
device
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
tmp_len
);
}
TRACE
(
"(%p, %p)
\n
"
,
dsb
,
ibp
);
size
=
tmp_len
/
oAdvance
;
/* Check for same sample rate */
if
(
dsb
->
freq
==
dsb
->
device
->
pwfx
->
nSamplesPerSec
)
{
TRACE
(
"(%p) Same sample rate %d = primary %d
\n
"
,
dsb
,
dsb
->
freq
,
dsb
->
device
->
pwfx
->
nSamplesPerSec
);
cp_fields
(
dsb
,
ibp
,
iAdvance
,
oAdvance
,
size
,
0
,
1
<<
DSOUND_FREQSHIFT
);
cp_fields
(
dsb
,
oAdvance
,
size
,
0
);
return
;
}
...
...
@@ -379,7 +376,7 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_l
DSOUND_secpos_to_bufpos
(
dsb
,
dsb
->
sec_mixpos
,
dsb
->
sec_mixpos
,
&
freqAcc
);
/* FIXME: Small problem here when we're overwriting buf_mixpos, it then STILL uses old freqAcc, not sure if it matters or not */
cp_fields
(
dsb
,
ibp
,
iAdvance
,
oAdvance
,
size
,
freqAcc
,
dsb
->
freqAdjust
);
cp_fields
(
dsb
,
oAdvance
,
size
,
freqAcc
);
}
/** Apply volume to the given soundbuffer from (primary) position writepos and length len
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment