summaryrefslogtreecommitdiff
path: root/audio/xmms-osx/patches/patch-aa
blob: f58dc5fd2e6f057aaacd4cfc6fe2149b8141aaba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-aa,v 1.1.1.1 2006/08/28 05:11:06 ben Exp $

--- src/audio.c.orig	2004-06-13 15:43:04.000000000 -0700
+++ src/audio.c
@@ -257,7 +257,14 @@ gint osx_get_written_time(void)
 gint osx_get_output_time(void)
 {
 	gint retval;
-
+	// output.bps is updated several times per second, however
+	// this function is called before output.bps is initalized,
+	// causing a divide by zero floating point exception.
+	// in this case, choose a sane default value.  it will be
+	// overwritten in a few microseconds, so the value is not
+	// critical.  --Ben
+        if (output.bps == 0)
+		output.bps = 384000;
 	retval = output_time_offset + ((output_total * sample_size * 1000) / output.bps);
 	retval = (int)((float)retval / user_pitch);