changeset 6630:daf0d43ccde2

Patch to improve bufferhandling on OpenBSD and NetBSD, by Bj«Órn Sandell and Bernd Ernesti <mplayer at lists.veego.de>
author atmos4
date Wed, 03 Jul 2002 21:17:31 +0000
parents e8959a17ce38
children 4843214cf2a1
files libao2/ao_sun.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_sun.c	Wed Jul 03 19:15:14 2002 +0000
+++ b/libao2/ao_sun.c	Wed Jul 03 21:17:31 2002 +0000
@@ -445,13 +445,19 @@
     }
 #endif
 
-#ifndef __OpenBSD__
+#if !defined (__OpenBSD__) && !defined(__NetBSD__)
     ioctl(audio_fd, AUDIO_GETINFO, &info);
     if (queued_bursts - info.play.eof > 2)
 	return 0;
 #endif
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+    ioctl(audio_fd, AUDIO_GETINFO, &info);
+    return info.hiwat * info.blocksize - info.play.seek;
+#else
     return ao_data.outburst;
+#endif
+
 }
 
 // plays 'len' bytes of 'data'
@@ -507,7 +513,7 @@
 static float get_delay(){
     audio_info_t info;
     ioctl(audio_fd, AUDIO_GETINFO, &info);
-#ifdef __OpenBSD__
+#if defined (__OpenBSD__) || defined(__NetBSD__)
     return (float) info.play.seek/ (float)byte_per_sec ;
 #else
     if (info.play.samples && enable_sample_timing == RTSC_ENABLED)