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
ce06de42
Commit
ce06de42
authored
Dec 22, 2008
by
Reece Dunn
Committed by
Alexandre Julliard
Dec 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Correct the dsound fraglen calculations.
parent
f9e0e519
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
primary.c
dlls/dsound/primary.c
+14
-9
No files found.
dlls/dsound/primary.c
View file @
ce06de42
...
@@ -46,19 +46,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
...
@@ -46,19 +46,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
*/
*/
DWORD
DSOUND_fraglen
(
DWORD
nSamplesPerSec
,
DWORD
nBlockAlign
)
DWORD
DSOUND_fraglen
(
DWORD
nSamplesPerSec
,
DWORD
nBlockAlign
)
{
{
DWORD
fraglen
=
256
*
nBlockAlign
;
/* Given a timer delay of 10ms, the fragment size is approximately:
* fraglen = (nSamplesPerSec * 10 / 1000) * nBlockAlign
* ==> fraglen = (nSamplesPerSec / 100) * nBlockSize
*
* ALSA uses buffers that are powers of 2. Because of this, fraglen
* is rounded up to the nearest power of 2:
*/
/* Compensate for only being roughly accurate */
if
(
nSamplesPerSec
<=
12800
)
if
(
nSamplesPerSec
<=
26000
)
return
128
*
nBlockAlign
;
fraglen
/=
2
;
if
(
nSamplesPerSec
<=
100
00
)
if
(
nSamplesPerSec
<=
256
00
)
fraglen
/=
2
;
return
256
*
nBlockAlign
;
if
(
nSamplesPerSec
>=
800
00
)
if
(
nSamplesPerSec
<=
512
00
)
fraglen
*=
2
;
return
512
*
nBlockAlign
;
return
fragle
n
;
return
1024
*
nBlockAlig
n
;
}
}
static
void
DSOUND_RecalcPrimary
(
DirectSoundDevice
*
device
)
static
void
DSOUND_RecalcPrimary
(
DirectSoundDevice
*
device
)
...
...
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