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
7c80f993
Commit
7c80f993
authored
Apr 27, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Apr 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore the 2 MHz sample rate test and fix the winealsa driver for
reasonable limits.
parent
74f583ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
7 deletions
+50
-7
wave.c
dlls/winmm/tests/wave.c
+48
-6
audio.c
dlls/winmm/winealsa/audio.c
+2
-1
No files found.
dlls/winmm/tests/wave.c
View file @
7c80f993
...
...
@@ -324,12 +324,12 @@ static void wave_out_tests()
}
}
/* Try
an invalid format
to test error handling */
trace
(
"Testing invalid format
\n
"
);
/* Try
invalid formats
to test error handling */
trace
(
"Testing invalid format
: 11 bits per sample
\n
"
);
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
format
.
nChannels
=
2
;
format
.
wBitsPerSample
=
11
;
format
.
nSamplesPerSec
=
800
0
;
format
.
nSamplesPerSec
=
2205
0
;
format
.
nBlockAlign
=
format
.
nChannels
*
format
.
wBitsPerSample
/
8
;
format
.
nAvgBytesPerSec
=
format
.
nSamplesPerSec
*
format
.
nBlockAlign
;
format
.
cbSize
=
0
;
...
...
@@ -345,6 +345,27 @@ static void wave_out_tests()
oformat
.
nChannels
);
waveOutClose
(
wout
);
}
trace
(
"Testing invalid format: 2 MHz sample rate
\n
"
);
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
format
.
nChannels
=
2
;
format
.
wBitsPerSample
=
16
;
format
.
nSamplesPerSec
=
2000000
;
format
.
nBlockAlign
=
format
.
nChannels
*
format
.
wBitsPerSample
/
8
;
format
.
nAvgBytesPerSec
=
format
.
nSamplesPerSec
*
format
.
nBlockAlign
;
format
.
cbSize
=
0
;
oformat
=
format
;
rc
=
waveOutOpen
(
&
wout
,
d
,
&
format
,
0
,
0
,
CALLBACK_NULL
|
WAVE_FORMAT_DIRECT
);
ok
(
rc
==
WAVERR_BADFORMAT
||
rc
==
MMSYSERR_INVALFLAG
,
"waveOutOpen: opening the device at 2 MHz sample rate should fail %d: rc=%d
\n
"
,
d
,
rc
);
if
(
rc
==
MMSYSERR_NOERROR
)
{
trace
(
" got %ldx%2dx%d for %ldx%2dx%d
\n
"
,
format
.
nSamplesPerSec
,
format
.
wBitsPerSample
,
format
.
nChannels
,
oformat
.
nSamplesPerSec
,
oformat
.
wBitsPerSample
,
oformat
.
nChannels
);
waveOutClose
(
wout
);
}
}
}
...
...
@@ -525,12 +546,12 @@ static void wave_in_tests()
}
}
/* Try
an invalid format
to test error handling */
trace
(
"Testing invalid format
\n
"
);
/* Try
invalid formats
to test error handling */
trace
(
"Testing invalid format
: 11 bits per sample
\n
"
);
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
format
.
nChannels
=
2
;
format
.
wBitsPerSample
=
11
;
format
.
nSamplesPerSec
=
800
0
;
format
.
nSamplesPerSec
=
2205
0
;
format
.
nBlockAlign
=
format
.
nChannels
*
format
.
wBitsPerSample
/
8
;
format
.
nAvgBytesPerSec
=
format
.
nSamplesPerSec
*
format
.
nBlockAlign
;
format
.
cbSize
=
0
;
...
...
@@ -546,6 +567,27 @@ static void wave_in_tests()
oformat
.
nChannels
);
waveInClose
(
win
);
}
trace
(
"Testing invalid format: 2 MHz sample rate
\n
"
);
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
format
.
nChannels
=
2
;
format
.
wBitsPerSample
=
16
;
format
.
nSamplesPerSec
=
2000000
;
format
.
nBlockAlign
=
format
.
nChannels
*
format
.
wBitsPerSample
/
8
;
format
.
nAvgBytesPerSec
=
format
.
nSamplesPerSec
*
format
.
nBlockAlign
;
format
.
cbSize
=
0
;
oformat
=
format
;
rc
=
waveInOpen
(
&
win
,
d
,
&
format
,
0
,
0
,
CALLBACK_NULL
|
WAVE_FORMAT_DIRECT
);
ok
(
rc
==
WAVERR_BADFORMAT
||
rc
==
MMSYSERR_INVALFLAG
,
"waveInOpen: opening the device with 2 MHz sample rate should fail %d: rc=%d
\n
"
,
d
,
rc
);
if
(
rc
==
MMSYSERR_NOERROR
)
{
trace
(
" got %ldx%2dx%d for %ldx%2dx%d
\n
"
,
format
.
nSamplesPerSec
,
format
.
wBitsPerSample
,
format
.
nChannels
,
oformat
.
nSamplesPerSec
,
oformat
.
wBitsPerSample
,
oformat
.
nChannels
);
waveInClose
(
win
);
}
}
}
...
...
dlls/winmm/winealsa/audio.c
View file @
7c80f993
...
...
@@ -1438,7 +1438,8 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* only PCM format is supported so far... */
if
(
lpDesc
->
lpFormat
->
wFormatTag
!=
WAVE_FORMAT_PCM
||
lpDesc
->
lpFormat
->
nChannels
==
0
||
lpDesc
->
lpFormat
->
nSamplesPerSec
==
0
||
lpDesc
->
lpFormat
->
nSamplesPerSec
<
DSBFREQUENCY_MIN
||
lpDesc
->
lpFormat
->
nSamplesPerSec
>
DSBFREQUENCY_MAX
||
(
lpDesc
->
lpFormat
->
wBitsPerSample
!=
8
&&
lpDesc
->
lpFormat
->
wBitsPerSample
!=
16
))
{
WARN
(
"Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !
\n
"
,
lpDesc
->
lpFormat
->
wFormatTag
,
lpDesc
->
lpFormat
->
nChannels
,
...
...
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