aboutsummaryrefslogtreecommitdiff
path: root/hw/sb16.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/sb16.c')
-rw-r--r--hw/sb16.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/sb16.c b/hw/sb16.c
index a94e6899e9..8973c5ef25 100644
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -640,8 +640,8 @@ static void complete (SB16State *s)
s->freq = 11025;
samples = dsp_get_lohi (s);
bytes = samples << s->fmt_stereo << (s->fmt_bits == 16);
- ticks = ticks_per_sec / (s->freq / bytes);
- if (ticks < ticks_per_sec / 1024)
+ ticks = bytes ? (ticks_per_sec / (s->freq / bytes)) : 0;
+ if (!bytes || ticks < ticks_per_sec / 1024)
pic_set_irq (s->irq, 1);
else
qemu_mod_timer (s->aux_ts, qemu_get_clock (vm_clock) + ticks);