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
f3ed32bc
Commit
f3ed32bc
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: Allow mixing the same buffer multiple times if we are looping.
parent
93b6f158
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
16 deletions
+30
-16
mixer.c
dlls/dsound/mixer.c
+30
-16
No files found.
dlls/dsound/mixer.c
View file @
f3ed32bc
...
...
@@ -543,6 +543,12 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
dsb
->
leadin
=
FALSE
;
}
/* check for notification positions */
if
(
dsb
->
dsbd
.
dwFlags
&
DSBCAPS_CTRLPOSITIONNOTIFY
&&
dsb
->
state
!=
STATE_STARTING
)
{
DSOUND_CheckEvent
(
dsb
,
dsb
->
buf_mixpos
,
ilen
);
}
dsb
->
buf_mixpos
+=
ilen
;
if
(
dsb
->
buf_mixpos
>=
dsb
->
buflen
)
{
...
...
@@ -557,6 +563,9 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
}
}
/* increase mix position */
dsb
->
primary_mixpos
+=
len
;
dsb
->
primary_mixpos
%=
dsb
->
device
->
buflen
;
return
len
;
}
...
...
@@ -607,27 +616,32 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri
}
/* take into acount already mixed data */
mixlen
=
mixlen
-
primary_done
;
TRACE
(
"mixlen (primary) = %i
\n
"
,
mixlen
);
/* clip to valid length */
mixlen
=
(
buflen
<
mixlen
)
?
buflen
:
mixlen
;
mixlen
-=
primary_done
;
TRACE
(
"primary_done=%d, mixlen (
buffer)=%d
\n
"
,
primary_done
,
mixlen
);
TRACE
(
"primary_done=%d, mixlen (
primary) = %i
\n
"
,
primary_done
,
mixlen
);
/* mix more data */
mixlen
=
DSOUND_MixInBuffer
(
dsb
,
dsb
->
primary_mixpos
,
mixlen
);
if
((
dsb
->
playflags
&
DSBPLAY_LOOPING
)
&&
mixlen
>
buflen
)
{
while
(
mixlen
>
buflen
)
{
DWORD
mixedlength
=
DSOUND_MixInBuffer
(
dsb
,
dsb
->
primary_mixpos
,
buflen
);
mixlen
-=
buflen
;
if
(
!
mixedlength
)
{
mixlen
=
0
;
break
;
}
}
/* check for notification positions */
if
(
dsb
->
dsbd
.
dwFlags
&
DSBCAPS_CTRLPOSITIONNOTIFY
&&
dsb
->
state
!=
STATE_STARTING
)
{
DSOUND_CheckEvent
(
dsb
,
writepos
,
mixlen
/
dsb
->
device
->
pwfx
->
nBlockAlign
*
dsb
->
pwfx
->
nBlockAlign
);
}
/* increase mix position */
dsb
->
primary_mixpos
+=
mixlen
;
dsb
->
primary_mixpos
%=
dsb
->
device
->
buflen
;
/* clip to valid length */
mixlen
=
(
buflen
<
mixlen
)
?
buflen
:
mixlen
;
TRACE
(
"mixlen (buffer)=%d
\n
"
,
mixlen
);
if
(
mixlen
)
/* mix more data */
mixlen
=
DSOUND_MixInBuffer
(
dsb
,
dsb
->
primary_mixpos
,
mixlen
);
TRACE
(
"new primary_mixpos=%d, mixed data len=%d, buffer left = %d
\n
"
,
dsb
->
primary_mixpos
,
mixlen
,
(
dsb
->
buflen
-
dsb
->
buf_mixpos
));
...
...
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