Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
423276a3
Commit
423276a3
authored
Nov 25, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ao: support all libao error codes
The function audioOutputAo_error() did not implement all possible libao error codes. Support the rest of them, and fall back to strerror().
parent
ffc60449
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
ao_plugin.c
src/output/ao_plugin.c
+29
-9
No files found.
src/output/ao_plugin.c
View file @
423276a3
...
...
@@ -42,15 +42,36 @@ static AoData *newAoData(void)
return
ret
;
}
static
void
audioOutputAo_error
(
void
)
static
void
audioOutputAo_error
(
const
char
*
msg
)
{
if
(
errno
==
AO_ENOTLIVE
)
{
g_warning
(
"not a live ao device
\n
"
);
}
else
if
(
errno
==
AO_EOPENDEVICE
)
{
g_warning
(
"not able to open audio device
\n
"
);
}
else
if
(
errno
==
AO_EBADOPTION
)
{
g_warning
(
"bad driver option
\n
"
);
const
char
*
error
;
switch
(
errno
)
{
case
AO_ENODRIVER
:
error
=
"No such libao driver"
;
break
;
case
AO_ENOTLIVE
:
error
=
"This driver is not a libao live device"
;
break
;
case
AO_EBADOPTION
:
error
=
"Invalid libao option"
;
break
;
case
AO_EOPENDEVICE
:
error
=
"Cannot open the libao device"
;
break
;
case
AO_EFAIL
:
error
=
"Generic libao failure"
;
break
;
default:
error
=
strerror
(
errno
);
}
g_warning
(
"%s: %s
\n
"
,
msg
,
error
);
}
static
void
*
audioOutputAo_initDriver
(
struct
audio_output
*
ao
,
...
...
@@ -224,8 +245,7 @@ audioOutputAo_play(void *data, const char *playChunk, size_t size)
?
size
:
(
size_t
)
ad
->
writeSize
;
if
(
ao_play_deconst
(
ad
->
device
,
playChunk
,
chunk_size
)
==
0
)
{
audioOutputAo_error
();
g_warning
(
"closing audio device due to write error
\n
"
);
audioOutputAo_error
(
"Closing libao device due to play error"
);
return
false
;
}
...
...
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