[MPlayer-dev-eng] [PATCH] NetBSD sun audio patch to play better
Björn Sandell
biorn at dce.chalmers.se
Wed Jul 3 19:26:37 CEST 2002
Hi,
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
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 17:31:41 -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