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
bbb01ae0
Commit
bbb01ae0
authored
Jun 05, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Jun 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a problem where actual sample rate doesn't exactly match
requested.
parent
623fb34a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
audio.c
dlls/winmm/winealsa/audio.c
+8
-2
No files found.
dlls/winmm/winealsa/audio.c
View file @
bbb01ae0
...
...
@@ -324,6 +324,12 @@ static const char * getFormat(WORD wFormatTag)
return
unknown
;
}
/* Allow 1% deviation for sample rates (some ES137x cards) */
static
BOOL
NearMatch
(
int
rate1
,
int
rate2
)
{
return
(((
100
*
(
rate1
-
rate2
))
/
rate1
)
==
0
);
}
static
DWORD
bytes_to_mmtime
(
LPMMTIME
lpTime
,
DWORD
position
,
WAVEFORMATPCMEX
*
format
)
{
...
...
@@ -1928,7 +1934,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
snd_pcm_close
(
pcm
);
return
WAVERR_BADFORMAT
;
}
if
(
rate
!=
wwo
->
format
.
Format
.
nSamplesPerSec
)
{
if
(
!
NearMatch
(
rate
,
wwo
->
format
.
Format
.
nSamplesPerSec
)
)
{
if
(
dwFlags
&
WAVE_DIRECTSOUND
)
{
WARN
(
"changed sample rate from %ld Hz to %d Hz
\n
"
,
wwo
->
format
.
Format
.
nSamplesPerSec
,
rate
);
wwo
->
format
.
Format
.
nSamplesPerSec
=
rate
;
...
...
@@ -3411,7 +3417,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
snd_pcm_close
(
pcm
);
return
WAVERR_BADFORMAT
;
}
if
(
rate
!=
wwi
->
format
.
Format
.
nSamplesPerSec
)
{
if
(
!
NearMatch
(
rate
,
wwi
->
format
.
Format
.
nSamplesPerSec
)
)
{
WARN
(
"Rate doesn't match (requested %ld Hz, got %d Hz)
\n
"
,
wwi
->
format
.
Format
.
nSamplesPerSec
,
rate
);
snd_pcm_close
(
pcm
);
return
WAVERR_BADFORMAT
;
...
...
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