aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/output/alsa_plugin.c8
-rw-r--r--src/output/httpd_output_plugin.c5
-rw-r--r--src/output/shout_plugin.c2
-rw-r--r--src/output_thread.c7
4 files changed, 18 insertions, 4 deletions
diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c
index 1c8c7b7f7..0bbe231fd 100644
--- a/src/output/alsa_plugin.c
+++ b/src/output/alsa_plugin.c
@@ -508,6 +508,14 @@ configure_hw:
g_debug("buffer_size=%u period_size=%u",
(unsigned)alsa_buffer_size, (unsigned)alsa_period_size);
+ if (alsa_period_size == 0)
+ /* this works around a SIGFPE bug that occurred when
+ an ALSA driver indicated period_size==0; this
+ caused a division by zero in alsa_play(). By using
+ the fallback "1", we make sure that this won't
+ happen again. */
+ alsa_period_size = 1;
+
ad->period_frames = alsa_period_size;
ad->period_position = 0;
diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c
index 20098c90e..3f570c7b9 100644
--- a/src/output/httpd_output_plugin.c
+++ b/src/output/httpd_output_plugin.c
@@ -493,7 +493,8 @@ httpd_output_pause(void *data)
if (has_clients) {
static const char silence[1020];
- return httpd_output_play(data, silence, sizeof(silence), NULL);
+ return httpd_output_play(data, silence, sizeof(silence),
+ NULL) > 0;
} else {
g_usleep(100000);
return true;
@@ -522,7 +523,7 @@ httpd_output_tag(void *data, const struct tag *tag)
/* flush the current stream, and end it */
- encoder_flush(httpd->encoder, NULL);
+ encoder_pre_tag(httpd->encoder, NULL);
httpd_output_encoder_to_clients(httpd);
/* send the tag to the encoder - which starts a new
diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c
index ec5fca3d9..7a4d70e70 100644
--- a/src/output/shout_plugin.c
+++ b/src/output/shout_plugin.c
@@ -518,7 +518,7 @@ static void my_shout_set_tag(void *data,
if (sd->encoder->plugin->tag != NULL) {
/* encoder plugin supports stream tags */
- ret = encoder_flush(sd->encoder, &error);
+ ret = encoder_pre_tag(sd->encoder, &error);
if (!ret) {
g_warning("%s", error->message);
g_error_free(error);
diff --git a/src/output_thread.c b/src/output_thread.c
index 21096eb04..ec5fc5b31 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -641,8 +641,13 @@ static gpointer audio_output_task(gpointer arg)
case AO_COMMAND_CANCEL:
ao->chunk = NULL;
- if (ao->open)
+
+ if (ao->open) {
+ g_mutex_unlock(ao->mutex);
ao_plugin_cancel(ao->plugin, ao->data);
+ g_mutex_lock(ao->mutex);
+ }
+
ao_command_finished(ao);
/* the player thread will now clear our music