aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-20 20:41:21 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-20 20:41:21 +0000
commit72a7740fd5755d09e13978bde7f729deb43bdd55 (patch)
tree019f3e630680fabe7cfa5755f1497b142f5f1f34 /src/audio.c
parenteefcf79436c80075fa373e65bf6249ba9b4c9b04 (diff)
downloadmpd-72a7740fd5755d09e13978bde7f729deb43bdd55.tar.gz
mpd-72a7740fd5755d09e13978bde7f729deb43bdd55.tar.xz
mpd-72a7740fd5755d09e13978bde7f729deb43bdd55.zip
shout audioOutput will now connect and disconnect from icecast server
git-svn-id: https://svn.musicpd.org/mpd/trunk@2285 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c
index dbc5273f1..b897d8bc9 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -32,6 +32,7 @@ static AudioFormat audio_format;
static AudioFormat * audio_configFormat = NULL;
static AudioOutput * aoOutput = NULL;
+static AudioOutput * shoutOutput = NULL;
static void copyAudioFormat(AudioFormat * dest, AudioFormat * src) {
dest->sampleRate = src->sampleRate;
@@ -49,6 +50,7 @@ void initAudioDriver() {
aoOutput = newAudioOutput("ao");
assert(aoOutput);
+ shoutOutput = newAudioOutput("shout");
}
void getOutputAudioFormat(AudioFormat * inAudioFormat,
@@ -134,6 +136,7 @@ void finishAudioConfig() {
void finishAudioDriver() {
finishAudioOutput(aoOutput);
+ if(shoutOutput) finishAudioOutput(shoutOutput);
aoOutput = NULL;
}
@@ -148,6 +151,7 @@ int isCurrentAudioFormat(AudioFormat * audioFormat) {
int openAudioDevice(AudioFormat * audioFormat) {
if(!aoOutput->open || !isCurrentAudioFormat(audioFormat)) {
copyAudioFormat(&audio_format, audioFormat);
+ if(shoutOutput) openAudioOutput(shoutOutput, audioFormat);
return openAudioOutput(aoOutput, audioFormat);
}
@@ -155,6 +159,7 @@ int openAudioDevice(AudioFormat * audioFormat) {
}
int playAudio(char * playChunk, int size) {
+ if(shoutOutput) playAudioOutput(shoutOutput, playChunk, size);
return playAudioOutput(aoOutput, playChunk, size);
}
@@ -163,5 +168,6 @@ int isAudioDeviceOpen() {
}
void closeAudioDevice() {
+ if(shoutOutput) closeAudioOutput(shoutOutput);
closeAudioOutput(aoOutput);
}