aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/alsa_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-20 21:46:05 +0200
committerMax Kellermann <max@duempel.org>2011-07-20 21:46:05 +0200
commit0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3 (patch)
treed08d18c852febad9d6da94dfbe31545dcf93b5d0 /src/output/alsa_plugin.c
parent57936a13741c09fa54a33a53ed05ac0d996e4807 (diff)
parent838f7cd210dbd3f071d48d54c168c123c3d20c58 (diff)
downloadmpd-0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3.tar.gz
mpd-0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3.tar.xz
mpd-0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3.zip
Merge branch 'v0.16.x'
Conflicts: src/player_thread.c src/playlist_control.c
Diffstat (limited to 'src/output/alsa_plugin.c')
-rw-r--r--src/output/alsa_plugin.c8
1 files changed, 8 insertions, 0 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;