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

Björn Sandell biorn at dce.chalmers.se
Wed Jul 3 22:55:11 CEST 2002


On Wed, 3 Jul 2002, Felix Buenemann wrote:

> On Wednesday 03 July 2002 19:26, Björn Sandell wrote:
> > On Wed, 3 Jul 2002, Bernd Ernesti wrote:
> > > here is a small patch for libao2/ao_sun.c so it plays better on NetBSD.
> >
> > Seems to work well on OpenBSD too, so I'd like to extend it to
> lalalalala, repeating for 1bilionst time that patches should be send as 
> ATTACHMENT!

Opps, mea culpa, here you go.

Björn Sandell       DCE/DFS Sysadmin       IT department
Chalmers University of Technology    www.dce.chalmers.se
-------------- 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 20:58:43 -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)


More information about the MPlayer-dev-eng mailing list