[MPlayer-dev-eng] [PATCH] NetBSD sun audio patch to play better

Bernd Ernesti mplayer at lists.veego.de
Wed Jul 3 17:41:59 CEST 2002


Hi,

here is a small patch for libao2/ao_sun.c so it plays better on NetBSD.

The patch is from Frederick Bruckman and he send it to me along with this
description:

> Out of the box, the sun audio driver doesn't work for me well at all.
> The assumptions about the buffer size given Sun hardware are evidently
> not correct on my hardware, making it stall horribly. The NetBSD Sun
> compatible device is actually more capable than Sun's, and can report
> the free space accurrately, so with the attached patch, it works at
> least as well as with oss audio.

Regards,
Bernd

-------------- next part --------------
Index: libao2/ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.16
diff -u -r1.16 ao_sun.c
--- libao2/ao_sun.c	29 Apr 2002 08:47:30 -0000	1.16
+++ libao2/ao_sun.c	3 Jul 2002 15:31:07 -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__)
+    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)


More information about the MPlayer-dev-eng mailing list