aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutput_shout.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-01 20:02:08 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-01 20:02:08 +0000
commit023fba803af65801671a9fb2e932abe9b33c3b14 (patch)
tree20ee56132f717150f5a552c1d9c5f955064334b1 /src/audioOutput_shout.c
parenteefe9df34e4faa4db1e6835fe536d97c022247db (diff)
downloadmpd-023fba803af65801671a9fb2e932abe9b33c3b14.tar.gz
mpd-023fba803af65801671a9fb2e932abe9b33c3b14.tar.xz
mpd-023fba803af65801671a9fb2e932abe9b33c3b14.zip
something
git-svn-id: https://svn.musicpd.org/mpd/trunk@2453 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audioOutput_shout.c')
-rw-r--r--src/audioOutput_shout.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/src/audioOutput_shout.c b/src/audioOutput_shout.c
index c6d769a9b..557445746 100644
--- a/src/audioOutput_shout.c
+++ b/src/audioOutput_shout.c
@@ -255,23 +255,20 @@ static void flushEncoder(ShoutData * sd) {
}*/
static void clearEncoder(ShoutData * sd) {
- /*finishEncoder(sd);*/
- /*flushEncoder(sd);*/
-
- ogg_stream_clear(&(sd->os));
- vorbis_block_clear(&(sd->vb));
- vorbis_dsp_clear(&(sd->vd));
- vorbis_comment_clear(&(sd->vc));
- vorbis_info_clear(&(sd->vi));
+ /*finishEncoder(sd);
+ flushEncoder(sd);*/
+
+ vorbis_comment_clear(&sd->vc);
+ ogg_stream_clear(&sd->os);
+ vorbis_block_clear(&sd->vb);
+ vorbis_dsp_clear(&sd->vd);
+ vorbis_info_clear(&sd->vi);
}
static void shout_closeShoutConn(ShoutData * sd) {
- DEBUG("closeShoutConn called\n");
-
if(sd->opened) {
clearEncoder(sd);
- shout_sync(sd->shoutConn);
if(shout_close(sd->shoutConn) != SHOUTERR_SUCCESS) {
ERROR("problem closing connection to shout server: "
"%s\n", shout_get_error(sd->shoutConn));
@@ -294,10 +291,6 @@ static void shout_finishDriver(AudioOutput * audioOutput) {
}
static void shout_closeDevice(AudioOutput * audioOutput) {
- ShoutData * sd = (ShoutData *)audioOutput->data;
-
- if(sd->opened) shout_sync(sd->shoutConn);
-
audioOutput->open = 0;
}
@@ -388,8 +381,6 @@ static int initEncoder(ShoutData * sd) {
static int shout_openShoutConn(AudioOutput * audioOutput) {
ShoutData * sd = (ShoutData *)audioOutput->data;
- DEBUG("openShoutConn called\n");
-
if(shout_open(sd->shoutConn) != SHOUTERR_SUCCESS)
{
ERROR("problem opening connection to shout server: %s\n",
@@ -455,7 +446,7 @@ static int shout_openDevice(AudioOutput * audioOutput,
static void shout_convertAudioFormat(ShoutData * sd, char ** chunkArgPtr,
int * sizeArgPtr)
{
- size_t size = pcm_sizeOfOutputBufferForAudioFormatConversion(
+ int size = pcm_sizeOfOutputBufferForAudioFormatConversion(
&(sd->inAudioFormat), *sizeArgPtr,
&(sd->outAudioFormat));
@@ -540,15 +531,14 @@ static int shout_play(AudioOutput * audioOutput, char * playChunk, int size) {
while(vorbis_bitrate_flushpacket(&(sd->vd), &(sd->op))) {
ogg_stream_packetin(&(sd->os), &(sd->op));
- do {
- if(ogg_stream_pageout(&(sd->os), &(sd->og)) == 0) {
- break;
- }
- if(write_page(sd) < 0) return -1;
- } while(ogg_page_eos(&(sd->og)));
}
}
+
+ while(ogg_stream_pageout(&(sd->os), &(sd->og)) != 0) {
+ if(write_page(sd) < 0) return -1;
+ }
+
return 0;
}