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
ffd98e9c
Commit
ffd98e9c
authored
Nov 04, 2002
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSS_RawOpenDevice should return an error if the format is not
supported.
parent
1cd81540
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
audio.c
dlls/winmm/wineoss/audio.c
+20
-7
No files found.
dlls/winmm/wineoss/audio.c
View file @
ffd98e9c
...
...
@@ -240,7 +240,7 @@ static const char *wodPlayerCmdString[] = {
*/
static
DWORD
OSS_RawOpenDevice
(
OSS_DEVICE
*
ossdev
,
int
*
frag
)
{
int
fd
,
val
;
int
fd
,
val
,
err
;
if
((
fd
=
open
(
ossdev
->
dev_name
,
ossdev
->
open_access
|
O_NDELAY
,
0
))
==
-
1
)
{
...
...
@@ -262,25 +262,38 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int* frag)
{
val
=
ossdev
->
format
;
ioctl
(
fd
,
SNDCTL_DSP_SETFMT
,
&
val
);
if
(
val
!=
ossdev
->
format
)
ERR
(
"Can't set format to %d (%d)
\n
"
,
ossdev
->
format
,
val
);
if
(
val
!=
ossdev
->
format
)
{
ERR
(
"Can't set format to %d (returned %d)
\n
"
,
val
,
ossdev
->
format
);
err
=
WAVERR_BADFORMAT
;
goto
error
;
}
}
if
(
ossdev
->
stereo
)
{
val
=
ossdev
->
stereo
;
ioctl
(
fd
,
SNDCTL_DSP_STEREO
,
&
val
);
if
(
val
!=
ossdev
->
stereo
)
ERR
(
"Can't set stereo to %u (%d)
\n
"
,
ossdev
->
stereo
,
val
);
if
(
val
!=
ossdev
->
stereo
)
{
ERR
(
"Can't set stereo to %u (returned %d)
\n
"
,
val
,
ossdev
->
stereo
);
err
=
WAVERR_BADFORMAT
;
goto
error
;
}
}
if
(
ossdev
->
sample_rate
)
{
val
=
ossdev
->
sample_rate
;
ioctl
(
fd
,
SNDCTL_DSP_SPEED
,
&
ossdev
->
sample_rate
);
if
(
!
NEAR_MATCH
(
val
,
ossdev
->
sample_rate
))
ERR
(
"Can't set sample_rate to %u (%d)
\n
"
,
ossdev
->
sample_rate
,
val
);
if
(
!
NEAR_MATCH
(
val
,
ossdev
->
sample_rate
))
{
ERR
(
"Can't set sample_rate to %u (returned %d)
\n
"
,
val
,
ossdev
->
sample_rate
);
err
=
WAVERR_BADFORMAT
;
goto
error
;
}
}
ossdev
->
fd
=
fd
;
return
MMSYSERR_NOERROR
;
error:
close
(
fd
);
return
err
;
}
/******************************************************************
...
...
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