aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_shout.h
diff options
context:
space:
mode:
authorEric Wollesen <encoded@xmtp.net>2008-09-12 15:57:43 +0200
committerMax Kellermann <max@duempel.org>2008-09-12 15:57:43 +0200
commitf482f83eb893314dbfe84ec04b017c7c469d8ca3 (patch)
treeb0b1455ac17345764ae7684f1c46d97503c207a0 /src/audioOutputs/audioOutput_shout.h
parentfcac05a207b6ff969e871984d6a923bc78aad914 (diff)
downloadmpd-f482f83eb893314dbfe84ec04b017c7c469d8ca3.tar.gz
mpd-f482f83eb893314dbfe84ec04b017c7c469d8ca3.tar.xz
mpd-f482f83eb893314dbfe84ec04b017c7c469d8ca3.zip
shout: added shout_buffer
The Ogg encoder is slightly less optimal under this configuration. It used to send shout data directly out of its ogg_page structures. Now, in the interest of encapsulation, it copies the data from its ogg_page structures into a buffer provided by the shout audio output plugin (see audioOutput_shout_ogg.c, line 77.) I suspect the performance impact is negligible. [mk: this patch and its description was separated from Eric's patch "Refactor and cleanup of shout Ogg and MP3 audio outputs"]
Diffstat (limited to 'src/audioOutputs/audioOutput_shout.h')
-rw-r--r--src/audioOutputs/audioOutput_shout.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/audioOutputs/audioOutput_shout.h b/src/audioOutputs/audioOutput_shout.h
index a68a40875..f145d7566 100644
--- a/src/audioOutputs/audioOutput_shout.h
+++ b/src/audioOutputs/audioOutput_shout.h
@@ -29,6 +29,12 @@
#include <shout/shout.h>
#include <vorbis/vorbisenc.h>
+typedef struct _shout_buffer {
+ unsigned char *data;
+ size_t len;
+ size_t max_len;
+} shout_buffer;
+
struct shout_data {
shout_t *shout_conn;
int shout_error;
@@ -61,15 +67,15 @@ struct shout_data {
/* the configured audio format */
struct audio_format audio_format;
-};
-int write_page(struct shout_data *sd);
+ shout_buffer buf;
+};
void copy_tag_to_vorbis_comment(struct shout_data *sd);
-void send_ogg_vorbis_header(struct shout_data *sd);
+int send_ogg_vorbis_header(struct shout_data *sd);
-void shout_ogg_encoder_clear_encoder(struct shout_data *sd);
+int shout_ogg_encoder_clear_encoder(struct shout_data *sd);
int init_encoder(struct shout_data *sd);