aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/audio.c24
-rw-r--r--src/output_control.c22
-rw-r--r--src/output_control.h20
-rw-r--r--src/output_init.c2
4 files changed, 34 insertions, 34 deletions
diff --git a/src/audio.c b/src/audio.c
index c6b0285d8..532db5f37 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -103,7 +103,7 @@ void initAudioDriver(void)
/* only allow param to be NULL if there just one audioOutput */
assert(param || (audioOutputArraySize == 1));
- if (!initAudioOutput(output, param)) {
+ if (!audio_output_init(output, param)) {
if (param)
{
FATAL("problems configuring output device "
@@ -229,7 +229,7 @@ void finishAudioDriver(void)
unsigned int i;
for (i = 0; i < audioOutputArraySize; i++) {
- finishAudioOutput(&audioOutputArray[i]);
+ audio_output_finish(&audioOutputArray[i]);
}
free(audioOutputArray);
@@ -263,16 +263,16 @@ static void syncAudioDeviceStates(void)
break;
case DEVICE_ON:
/* This will reopen only if the audio format changed */
- if (openAudioOutput(audioOutput, &audio_format) < 0)
+ if (audio_output_open(audioOutput, &audio_format) < 0)
audioDeviceStates[i] = DEVICE_ENABLE;
break;
case DEVICE_ENABLE:
- if (openAudioOutput(audioOutput, &audio_format) == 0)
+ if (audio_output_open(audioOutput, &audio_format) == 0)
audioDeviceStates[i] = DEVICE_ON;
break;
case DEVICE_DISABLE:
- dropBufferedAudioOutput(audioOutput);
- closeAudioOutput(audioOutput);
+ audio_output_cancel(audioOutput);
+ audio_output_close(audioOutput);
audioDeviceStates[i] = DEVICE_OFF;
}
}
@@ -291,8 +291,8 @@ static int flushAudioBuffer(void)
for (i = 0; i < audioOutputArraySize; ++i) {
if (audioDeviceStates[i] != DEVICE_ON)
continue;
- err = playAudioOutput(&audioOutputArray[i], audioBuffer,
- audioBufferPos);
+ err = audio_output_play(&audioOutputArray[i], audioBuffer,
+ audioBufferPos);
if (!err)
ret = 0;
else if (err < 0)
@@ -335,7 +335,7 @@ int openAudioDevice(const struct audio_format *audioFormat)
else {
/* close all devices if there was an error */
for (i = 0; i < audioOutputArraySize; ++i) {
- closeAudioOutput(&audioOutputArray[i]);
+ audio_output_close(&audioOutputArray[i]);
}
audioOpened = 0;
@@ -380,7 +380,7 @@ void dropBufferedAudio(void)
for (i = 0; i < audioOutputArraySize; ++i) {
if (audioDeviceStates[i] == DEVICE_ON)
- dropBufferedAudioOutput(&audioOutputArray[i]);
+ audio_output_cancel(&audioOutputArray[i]);
}
}
@@ -397,7 +397,7 @@ void closeAudioDevice(void)
for (i = 0; i < audioOutputArraySize; ++i) {
if (audioDeviceStates[i] == DEVICE_ON)
audioDeviceStates[i] = DEVICE_ENABLE;
- closeAudioOutput(&audioOutputArray[i]);
+ audio_output_close(&audioOutputArray[i]);
}
audioOpened = 0;
@@ -408,7 +408,7 @@ void sendMetadataToAudioDevice(const struct tag *tag)
unsigned int i;
for (i = 0; i < audioOutputArraySize; ++i) {
- sendMetadataToAudioOutput(&audioOutputArray[i], tag);
+ audio_output_send_tag(&audioOutputArray[i], tag);
}
}
diff --git a/src/output_control.c b/src/output_control.c
index a6a8cac74..8a5e14e00 100644
--- a/src/output_control.c
+++ b/src/output_control.c
@@ -22,8 +22,8 @@
#include "utils.h"
#include "audio.h"
-int openAudioOutput(struct audio_output *audioOutput,
- const struct audio_format *audioFormat)
+int audio_output_open(struct audio_output *audioOutput,
+ const struct audio_format *audioFormat)
{
int ret = 0;
@@ -41,7 +41,7 @@ int openAudioOutput(struct audio_output *audioOutput,
copyAudioFormat(&audioOutput->outAudioFormat,
&audioOutput->inAudioFormat);
if (audioOutput->open)
- closeAudioOutput(audioOutput);
+ audio_output_close(audioOutput);
}
if (!audioOutput->open)
@@ -77,8 +77,8 @@ static void convertAudioFormat(struct audio_output *audioOutput,
*chunkArgPtr = audioOutput->convBuffer;
}
-int playAudioOutput(struct audio_output *audioOutput,
- const char *playChunk, size_t size)
+int audio_output_play(struct audio_output *audioOutput,
+ const char *playChunk, size_t size)
{
int ret;
@@ -94,29 +94,29 @@ int playAudioOutput(struct audio_output *audioOutput,
return ret;
}
-void dropBufferedAudioOutput(struct audio_output *audioOutput)
+void audio_output_cancel(struct audio_output *audioOutput)
{
if (audioOutput->open)
audioOutput->plugin->cancel(audioOutput);
}
-void closeAudioOutput(struct audio_output *audioOutput)
+void audio_output_close(struct audio_output *audioOutput)
{
if (audioOutput->open)
audioOutput->plugin->close(audioOutput);
}
-void finishAudioOutput(struct audio_output *audioOutput)
+void audio_output_finish(struct audio_output *audioOutput)
{
- closeAudioOutput(audioOutput);
+ audio_output_close(audioOutput);
if (audioOutput->plugin->finish)
audioOutput->plugin->finish(audioOutput);
if (audioOutput->convBuffer)
free(audioOutput->convBuffer);
}
-void sendMetadataToAudioOutput(struct audio_output *audioOutput,
- const struct tag *tag)
+void audio_output_send_tag(struct audio_output *audioOutput,
+ const struct tag *tag)
{
if (audioOutput->plugin->send_tag)
audioOutput->plugin->send_tag(audioOutput, tag);
diff --git a/src/output_control.h b/src/output_control.h
index 6d646466d..e16229e21 100644
--- a/src/output_control.h
+++ b/src/output_control.h
@@ -27,15 +27,15 @@ struct audio_output_plugin;
struct audio_format;
struct tag;
-int initAudioOutput(struct audio_output *, ConfigParam * param);
-int openAudioOutput(struct audio_output *audioOutput,
- const struct audio_format *audioFormat);
-int playAudioOutput(struct audio_output *audioOutput,
- const char *playChunk, size_t size);
-void dropBufferedAudioOutput(struct audio_output *audioOutput);
-void closeAudioOutput(struct audio_output *audioOutput);
-void finishAudioOutput(struct audio_output *audioOutput);
-void sendMetadataToAudioOutput(struct audio_output *audioOutput,
- const struct tag *tag);
+int audio_output_init(struct audio_output *, ConfigParam * param);
+int audio_output_open(struct audio_output *audioOutput,
+ const struct audio_format *audioFormat);
+int audio_output_play(struct audio_output *audioOutput,
+ const char *playChunk, size_t size);
+void audio_output_cancel(struct audio_output *audioOutput);
+void audio_output_close(struct audio_output *audioOutput);
+void audio_output_finish(struct audio_output *audioOutput);
+void audio_output_send_tag(struct audio_output *audioOutput,
+ const struct tag *tag);
#endif
diff --git a/src/output_init.c b/src/output_init.c
index da76c7214..33352ca2a 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -36,7 +36,7 @@
if(bp) str = bp->value; \
}
-int initAudioOutput(struct audio_output *ao, ConfigParam * param)
+int audio_output_init(struct audio_output *ao, ConfigParam * param)
{
const char *name = NULL;
char *format = NULL;