aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-09 16:35:59 +0100
committerMax Kellermann <max@duempel.org>2009-02-09 16:35:59 +0100
commit4228e50e25e3b4084797d4a2da2e2f3697a90651 (patch)
treeed22c564208c1aafa9546542d190cba892f298a1
parent30aaeb9c7e54f05fe4cf2f550da5a5951e304935 (diff)
downloadmpd-4228e50e25e3b4084797d4a2da2e2f3697a90651.tar.gz
mpd-4228e50e25e3b4084797d4a2da2e2f3697a90651.tar.xz
mpd-4228e50e25e3b4084797d4a2da2e2f3697a90651.zip
shout: use libshout's synchronization
Removed the manual timer synchronization from the shout plugin. libshout's shout_sync() function does it for us.
-rw-r--r--NEWS1
-rw-r--r--src/output/shout_plugin.c25
-rw-r--r--src/output/shout_plugin.h3
3 files changed, 5 insertions, 24 deletions
diff --git a/NEWS b/NEWS
index ec8a1f987..04bd0bb06 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ ver 0.14.2 (2009/??/??)
- jack: reduced sleep time to 1ms
- shout: fixed memory leak in the mp3 encoder
- shout: switch to blocking mode
+ - shout: use libshout's synchronization
* mapper: remove trailing slashes from music_directory
* player: set player error when output device fails
diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c
index 0577957c0..993ba66ae 100644
--- a/src/output/shout_plugin.c
+++ b/src/output/shout_plugin.c
@@ -58,7 +58,6 @@ static struct shout_data *new_shout_data(void)
ret->bitrate = -1;
ret->quality = -2.0;
ret->timeout = DEFAULT_CONN_TIMEOUT;
- ret->timer = NULL;
ret->buf.len = 0;
return ret;
@@ -72,8 +71,6 @@ static void free_shout_data(struct shout_data *sd)
shout_free(sd->shout_conn);
if (sd->tag)
tag_free(sd->tag);
- if (sd->timer)
- timer_free(sd->timer);
free(sd);
}
@@ -356,8 +353,8 @@ static void my_shout_finish_driver(void *data)
static void my_shout_drop_buffered_audio(void *data)
{
+ G_GNUC_UNUSED
struct shout_data *sd = (struct shout_data *)data;
- timer_reset(sd->timer);
/* needs to be implemented for shout */
}
@@ -367,11 +364,6 @@ static void my_shout_close_device(void *data)
struct shout_data *sd = (struct shout_data *)data;
close_shout_conn(sd);
-
- if (sd->timer) {
- timer_free(sd->timer);
- sd->timer = NULL;
- }
}
static int shout_connect(struct shout_data *sd)
@@ -411,19 +403,15 @@ static int open_shout_conn(void *data)
return 0;
}
-static bool my_shout_open_device(void *data,
- struct audio_format *audio_format)
+static bool
+my_shout_open_device(void *data,
+ G_GNUC_UNUSED struct audio_format *audio_format)
{
struct shout_data *sd = (struct shout_data *)data;
if (open_shout_conn(sd) < 0)
return false;
- if (sd->timer)
- timer_free(sd->timer);
-
- sd->timer = timer_new(audio_format);
-
return true;
}
@@ -451,11 +439,6 @@ my_shout_play(void *data, const char *chunk, size_t size)
{
struct shout_data *sd = (struct shout_data *)data;
- if (!sd->timer->started)
- timer_start(sd->timer);
-
- timer_add(sd->timer, size);
-
if (sd->tag != NULL)
send_metadata(sd);
diff --git a/src/output/shout_plugin.h b/src/output/shout_plugin.h
index a7585aeee..c11f2be66 100644
--- a/src/output/shout_plugin.h
+++ b/src/output/shout_plugin.h
@@ -21,7 +21,6 @@
#include "../output_api.h"
#include "../conf.h"
-#include "../timer.h"
#include <shout/shout.h>
#include <glib.h>
@@ -72,8 +71,6 @@ struct shout_data {
int timeout;
- Timer *timer;
-
/* the configured audio format */
struct audio_format audio_format;