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
72b7071e
Commit
72b7071e
authored
Jun 05, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Jun 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return proper error code.
Change ERR to WARN for failed requests.
parent
f863bb59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
audio.c
dlls/winmm/winealsa/audio.c
+10
-10
No files found.
dlls/winmm/winealsa/audio.c
View file @
72b7071e
...
...
@@ -1837,7 +1837,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
int err; \
if ( (err = (f) ) < 0) \
{ \
ERR
(txt ": %s\n", snd_strerror(err)); \
WARN
(txt ": %s\n", snd_strerror(err)); \
snd_pcm_close(pcm); \
return e; \
} \
...
...
@@ -1867,7 +1867,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwo
->
format
.
Format
.
nAvgBytesPerSec
=
wwo
->
format
.
Format
.
nSamplesPerSec
*
wwo
->
format
.
Format
.
nBlockAlign
;
WARN
(
"changed number of channels from %d to %d
\n
"
,
lpDesc
->
lpFormat
->
nChannels
,
wwo
->
format
.
Format
.
nChannels
);
}
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_channels
(
pcm
,
hw_params
,
wwo
->
format
.
Format
.
nChannels
),
MMSYSERR_INVALPARAM
,
"unable to set required channels"
);
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_channels
(
pcm
,
hw_params
,
wwo
->
format
.
Format
.
nChannels
),
WAVERR_BADFORMAT
,
"unable to set required channels"
);
}
if
((
wwo
->
format
.
Format
.
wFormatTag
==
WAVE_FORMAT_PCM
)
||
...
...
@@ -1917,14 +1917,14 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
WARN
(
"changed bits per sample from %d to %d
\n
"
,
lpDesc
->
lpFormat
->
wBitsPerSample
,
wwo
->
format
.
Format
.
wBitsPerSample
);
}
}
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_format
(
pcm
,
hw_params
,
format
),
MMSYSERR_INVALPARAM
,
"unable to set required format"
);
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_format
(
pcm
,
hw_params
,
format
),
WAVERR_BADFORMAT
,
"unable to set required format"
);
}
rate
=
wwo
->
format
.
Format
.
nSamplesPerSec
;
dir
=
0
;
err
=
snd_pcm_hw_params_set_rate_near
(
pcm
,
hw_params
,
&
rate
,
&
dir
);
if
(
err
<
0
)
{
ERR
(
"Rate %ld Hz not available for playback: %s
\n
"
,
wwo
->
format
.
Format
.
nSamplesPerSec
,
snd_strerror
(
rate
));
WARN
(
"Rate %ld Hz not available for playback: %s
\n
"
,
wwo
->
format
.
Format
.
nSamplesPerSec
,
snd_strerror
(
rate
));
snd_pcm_close
(
pcm
);
return
WAVERR_BADFORMAT
;
}
...
...
@@ -1935,7 +1935,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* recalculate bytes per second */
wwo
->
format
.
Format
.
nAvgBytesPerSec
=
wwo
->
format
.
Format
.
nSamplesPerSec
*
wwo
->
format
.
Format
.
nBlockAlign
;
}
else
{
ERR
(
"Rate doesn't match (requested %ld Hz, got %d Hz)
\n
"
,
wwo
->
format
.
Format
.
nSamplesPerSec
,
rate
);
WARN
(
"Rate doesn't match (requested %ld Hz, got %d Hz)
\n
"
,
wwo
->
format
.
Format
.
nSamplesPerSec
,
rate
);
snd_pcm_close
(
pcm
);
return
WAVERR_BADFORMAT
;
}
...
...
@@ -3355,7 +3355,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
int err; \
if ( (err = (f) ) < 0) \
{ \
ERR
(txt ": %s\n", snd_strerror(err)); \
WARN
(txt ": %s\n", snd_strerror(err)); \
snd_pcm_close(pcm); \
return e; \
} \
...
...
@@ -3371,7 +3371,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
else
wwi
->
read
=
snd_pcm_mmap_readi
;
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_channels
(
pcm
,
hw_params
,
wwi
->
format
.
Format
.
nChannels
),
MMSYSERR_INVALPARAM
,
"unable to set required channels"
);
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_channels
(
pcm
,
hw_params
,
wwi
->
format
.
Format
.
nChannels
),
WAVERR_BADFORMAT
,
"unable to set required channels"
);
if
((
wwi
->
format
.
Format
.
wFormatTag
==
WAVE_FORMAT_PCM
)
||
((
wwi
->
format
.
Format
.
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
&&
...
...
@@ -3401,18 +3401,18 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return
WAVERR_BADFORMAT
;
}
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_format
(
pcm
,
hw_params
,
format
),
MMSYSERR_INVALPARAM
,
"unable to set required format"
);
EXIT_ON_ERROR
(
snd_pcm_hw_params_set_format
(
pcm
,
hw_params
,
format
),
WAVERR_BADFORMAT
,
"unable to set required format"
);
rate
=
wwi
->
format
.
Format
.
nSamplesPerSec
;
dir
=
0
;
err
=
snd_pcm_hw_params_set_rate_near
(
pcm
,
hw_params
,
&
rate
,
&
dir
);
if
(
err
<
0
)
{
ERR
(
"Rate %ld Hz not available for playback: %s
\n
"
,
wwi
->
format
.
Format
.
nSamplesPerSec
,
snd_strerror
(
rate
));
WARN
(
"Rate %ld Hz not available for playback: %s
\n
"
,
wwi
->
format
.
Format
.
nSamplesPerSec
,
snd_strerror
(
rate
));
snd_pcm_close
(
pcm
);
return
WAVERR_BADFORMAT
;
}
if
(
rate
!=
wwi
->
format
.
Format
.
nSamplesPerSec
)
{
ERR
(
"Rate doesn't match (requested %ld Hz, got %d Hz)
\n
"
,
wwi
->
format
.
Format
.
nSamplesPerSec
,
rate
);
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