pkgsrc/audio/xmms-osx/patches/patch-aa

20 lines
745 B
Text

$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);