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
0190c50a
Commit
0190c50a
authored
Jan 03, 2017
by
Andrew Eikum
Committed by
Alexandre Julliard
Jan 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Don't write more than three periods to IAudioClient.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
046fc19c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
primary.c
dlls/dsound/primary.c
+11
-8
No files found.
dlls/dsound/primary.c
View file @
0190c50a
...
...
@@ -296,12 +296,12 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave)
{
HRESULT
hres
;
REFERENCE_TIME
period
;
UINT32
frames
;
UINT32
acbuf_frames
,
aclen_
frames
;
DWORD
period_ms
;
IAudioClient
*
client
=
NULL
;
IAudioRenderClient
*
render
=
NULL
;
IAudioStreamVolume
*
volume
=
NULL
;
DWORD
frag
len
;
DWORD
frag
_frames
;
WAVEFORMATEX
*
wfx
=
NULL
;
DWORD
oldspeakerconfig
=
device
->
speaker_config
;
...
...
@@ -350,17 +350,20 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave)
WARN
(
"GetStreamLatency failed with %08x
\n
"
,
hres
);
goto
err
;
}
hres
=
IAudioClient_GetBufferSize
(
client
,
&
frames
);
hres
=
IAudioClient_GetBufferSize
(
client
,
&
acbuf_
frames
);
if
(
FAILED
(
hres
))
{
WARN
(
"GetBufferSize failed with %08x
\n
"
,
hres
);
goto
err
;
}
period_ms
=
(
period
+
9999
)
/
10000
;
fraglen
=
MulDiv
(
wfx
->
nSamplesPerSec
,
period
,
10000000
)
*
wfx
->
nBlockAlign
;
TRACE
(
"period %u ms fraglen %u buflen %u
\n
"
,
period_ms
,
fraglen
,
frames
*
wfx
->
nBlockAlign
);
frag_frames
=
MulDiv
(
wfx
->
nSamplesPerSec
,
period
,
10000000
);
hres
=
DSOUND_PrimaryOpen
(
device
,
wfx
,
frames
,
forcewave
);
aclen_frames
=
min
(
acbuf_frames
,
3
*
frag_frames
);
TRACE
(
"period %u ms fraglen %u buflen %u
\n
"
,
period_ms
,
frag_frames
*
wfx
->
nBlockAlign
,
aclen_frames
*
wfx
->
nBlockAlign
);
hres
=
DSOUND_PrimaryOpen
(
device
,
wfx
,
aclen_frames
,
forcewave
);
if
(
FAILED
(
hres
))
goto
err
;
...
...
@@ -368,8 +371,8 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave)
device
->
client
=
client
;
device
->
render
=
render
;
device
->
volume
=
volume
;
device
->
fraglen
=
frag
le
n
;
device
->
aclen
=
frames
*
wfx
->
nBlockAlign
;
device
->
fraglen
=
frag
_frames
*
wfx
->
nBlockAlig
n
;
device
->
aclen
=
aclen_
frames
*
wfx
->
nBlockAlign
;
if
(
period_ms
<
3
)
device
->
sleeptime
=
5
;
...
...
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