From f482f83eb893314dbfe84ec04b017c7c469d8ca3 Mon Sep 17 00:00:00 2001 From: Eric Wollesen Date: Fri, 12 Sep 2008 15:57:43 +0200 Subject: 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"] --- src/audioOutputs/audioOutput_shout.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/audioOutputs/audioOutput_shout.h') 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 #include +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); -- cgit v1.2.3