# HG changeset patch # User atmos4 # Date 1025731051 0 # Node ID daf0d43ccde2bddbc970d7200a52da5b0a468328 # Parent e8959a17ce38e3206c9f2a795343ed94b5026107 Patch to improve bufferhandling on OpenBSD and NetBSD, by Bj«Órn Sandell and Bernd Ernesti diff -r e8959a17ce38 -r daf0d43ccde2 libao2/ao_sun.c --- 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)