diff libao2/ao_sun.c @ 5872:02576893af2a

OpenBSD, NetBSD portability patches by Bj«Órn Sandell <biorn@dce.chalmers.se> Marcus <core@antbear.org> Bernd Ernesti <mplayer@lists.veego.de>
author arpi
date Sat, 27 Apr 2002 22:42:27 +0000
parents 08f739d36ae0
children 6a6107da2d82
line wrap: on
line diff
--- a/libao2/ao_sun.c	Sat Apr 27 21:03:59 2002 +0000
+++ b/libao2/ao_sun.c	Sat Apr 27 22:42:27 2002 +0000
@@ -440,9 +440,11 @@
     }
 #endif
 
+#ifndef __OpenBSD__
     ioctl(audio_fd, AUDIO_GETINFO, &info);
     if (queued_bursts - info.play.eof > 2)
 	return 0;
+#endif
 
     return ao_data.outburst;
 }
@@ -500,9 +502,13 @@
 static float get_delay(){
     audio_info_t info;
     ioctl(audio_fd, AUDIO_GETINFO, &info);
+#ifdef __OpenBSD__
+    return (float) info.play.seek/ (float)byte_per_sec ;
+#else
     if (info.play.samples && enable_sample_timing == RTSC_ENABLED)
 	return (float)(queued_samples - info.play.samples) / (float)byte_per_sec;
     else
 	return (float)((queued_bursts - info.play.eof) * ao_data.outburst) / (float)byte_per_sec;
+#endif
 }