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
1cc9ecb5
Commit
1cc9ecb5
authored
May 15, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
May 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Don't use IAudioClock::GetPosition to determine buffer fullness.
parent
d2ddd200
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
17 deletions
+15
-17
dsound_private.h
dlls/dsound/dsound_private.h
+0
-1
mixer.c
dlls/dsound/mixer.c
+14
-15
primary.c
dlls/dsound/primary.c
+1
-1
No files found.
dlls/dsound/dsound_private.h
View file @
1cc9ecb5
...
...
@@ -83,7 +83,6 @@ struct DirectSoundDevice
DWORD
priolevel
;
PWAVEFORMATEX
pwfx
;
UINT
timerID
,
playing_offs_bytes
,
in_mmdev_bytes
,
prebuf
,
helfrags
;
UINT64
last_pos_bytes
;
DWORD
fraglen
;
LPBYTE
buffer
;
DWORD
writelead
,
buflen
,
state
,
playpos
,
mixpos
;
...
...
dlls/dsound/mixer.c
View file @
1cc9ecb5
...
...
@@ -667,8 +667,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force)
*/
static
void
DSOUND_PerformMix
(
DirectSoundDevice
*
device
)
{
UINT64
clock_pos
,
clock_freq
,
pos_bytes
;
UINT
delta_frags
;
UINT32
pad
,
to_mix_frags
,
to_mix_bytes
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
device
);
...
...
@@ -676,28 +675,28 @@ static void DSOUND_PerformMix(DirectSoundDevice *device)
/* **** */
EnterCriticalSection
(
&
device
->
mixlock
);
hr
=
IAudioCl
ock_GetFrequency
(
device
->
clock
,
&
clock_freq
);
hr
=
IAudioCl
ient_GetCurrentPadding
(
device
->
client
,
&
pad
);
if
(
FAILED
(
hr
)){
WARN
(
"Get
Frequency
failed: %08x
\n
"
,
hr
);
LeaveCriticalSection
(
&
device
->
mixlock
);
WARN
(
"Get
CurrentPadding
failed: %08x
\n
"
,
hr
);
LeaveCriticalSection
(
&
device
->
mixlock
);
return
;
}
hr
=
IAudioClock_GetPosition
(
device
->
clock
,
&
clock_pos
,
NULL
);
if
(
FAILED
(
hr
)){
WARN
(
"GetCurrentPadding failed: %08x
\n
"
,
hr
);
LeaveCriticalSection
(
&
device
->
mixlock
);
to_mix_frags
=
device
->
prebuf
-
(
pad
*
device
->
pwfx
->
nBlockAlign
+
device
->
fraglen
-
1
)
/
device
->
fraglen
;
if
(
to_mix_frags
==
0
){
/* nothing to do! */
LeaveCriticalSection
(
&
device
->
mixlock
);
return
;
}
pos_bytes
=
(
clock_pos
*
device
->
pwfx
->
nSamplesPerSec
*
device
->
pwfx
->
nBlockAlign
)
/
clock_freq
;
to_mix_bytes
=
to_mix_frags
*
device
->
fraglen
;
delta_frags
=
(
pos_bytes
-
device
->
last_pos_bytes
)
/
device
->
fraglen
;
if
(
delta_frags
>
0
){
device
->
playing_offs_bytes
+=
delta_frags
*
device
->
fraglen
;
if
(
device
->
in_mmdev_bytes
>
0
){
DWORD
delta_bytes
=
min
(
to_mix_bytes
,
device
->
in_mmdev_bytes
);
device
->
in_mmdev_bytes
-=
delta_bytes
;
device
->
playing_offs_bytes
+=
delta_bytes
;
device
->
playing_offs_bytes
%=
device
->
buflen
;
device
->
in_mmdev_bytes
-=
delta_frags
*
device
->
fraglen
;
device
->
last_pos_bytes
=
pos_bytes
-
(
pos_bytes
%
device
->
fraglen
);
}
if
(
device
->
priolevel
!=
DSSCL_WRITEPRIMARY
)
{
...
...
dlls/dsound/primary.c
View file @
1cc9ecb5
...
...
@@ -196,7 +196,7 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device)
FillMemory
(
device
->
buffer
,
device
->
buflen
,
(
device
->
pwfx
->
wBitsPerSample
==
8
)
?
128
:
0
);
FillMemory
(
device
->
mix_buffer
,
device
->
mix_buffer_len
,
0
);
device
->
last_pos_bytes
=
device
->
playing_offs_bytes
=
device
->
in_mmdev_bytes
=
device
->
playpos
=
device
->
mixpos
=
0
;
device
->
playing_offs_bytes
=
device
->
in_mmdev_bytes
=
device
->
playpos
=
device
->
mixpos
=
0
;
return
DS_OK
;
}
...
...
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