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
ce577384
Commit
ce577384
authored
Oct 20, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor little changes to audio junk
git-svn-id:
https://svn.musicpd.org/mpd/trunk@2278
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
608ac668
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
17 deletions
+26
-17
audio.c
src/audio.c
+13
-14
audio.h
src/audio.h
+0
-2
audioOutput_ao.c
src/audioOutput_ao.c
+13
-1
No files found.
src/audio.c
View file @
ce577384
...
...
@@ -250,6 +250,19 @@ int openAudioDevice(AudioFormat * audioFormat) {
return
0
;
}
void
audioError
()
{
#ifdef HAVE_AUDIO
if
(
errno
==
AO_ENOTLIVE
)
{
ERROR
(
"not a live ao device
\n
"
);
}
else
if
(
errno
==
AO_EOPENDEVICE
)
{
ERROR
(
"not able to open audio device
\n
"
);
}
else
if
(
errno
==
AO_EBADOPTION
)
{
ERROR
(
"bad driver option
\n
"
);
}
#endif
}
int
playAudio
(
char
*
playChunk
,
int
size
)
{
#ifdef HAVE_AUDIO
...
...
@@ -293,17 +306,3 @@ void closeAudioDevice() {
}
#endif
}
void
audioError
()
{
#ifdef HAVE_AUDIO
if
(
errno
==
AO_ENOTLIVE
)
{
ERROR
(
"not a live ao device
\n
"
);
}
else
if
(
errno
==
AO_EOPENDEVICE
)
{
ERROR
(
"not able to open audio device
\n
"
);
}
else
if
(
errno
==
AO_EBADOPTION
)
{
ERROR
(
"bad driver option
\n
"
);
}
#endif
}
src/audio.h
View file @
ce577384
...
...
@@ -51,8 +51,6 @@ void closeAudioDevice();
int
isAudioDeviceOpen
();
void
audioError
();
int
isCurrentAudioFormat
(
AudioFormat
*
audioFormat
);
#endif
src/audioOutput_ao.c
View file @
ce577384
...
...
@@ -44,6 +44,18 @@ static AoData * newAoData() {
return
ret
;
}
static
void
audioOutputAo_error
()
{
if
(
errno
==
AO_ENOTLIVE
)
{
ERROR
(
"not a live ao device
\n
"
);
}
else
if
(
errno
==
AO_EOPENDEVICE
)
{
ERROR
(
"not able to open audio device
\n
"
);
}
else
if
(
errno
==
AO_EBADOPTION
)
{
ERROR
(
"bad driver option
\n
"
);
}
}
static
void
audioOutputAo_initDriver
(
AudioOutput
*
audioOutput
)
{
ao_info
*
ai
;
char
*
dup
;
...
...
@@ -183,7 +195,7 @@ static int audioOutputAo_play(AudioOutput * audioOutput, char * playChunk,
send
=
ad
->
writeSize
>
size
?
size
:
ad
->
writeSize
;
if
(
ao_play
(
ad
->
device
,
playChunk
,
send
)
==
0
)
{
audio
E
rror
();
audio
OutputAo_e
rror
();
ERROR
(
"closing audio device due to write error
\n
"
);
audioOutputAo_closeDevice
(
audioOutput
);
return
-
1
;
...
...
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