[Mplayer-cvslog] CVS: main/libao2 afmt.h,1.1,1.2 ao_oss.c,1.21,1.22 ao_sun.c,1.14,1.15
Arpi of Ize
arpi at mplayerhq.hu
Sun Apr 28 00:42:56 CEST 2002
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv19906/libao2
Modified Files:
afmt.h ao_oss.c ao_sun.c
Log Message:
OpenBSD, NetBSD portability patches by
Björn Sandell <biorn at dce.chalmers.se>
Marcus <core at antbear.org>
Bernd Ernesti <mplayer at lists.veego.de>
Index: afmt.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/afmt.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- afmt.h 8 Jun 2001 23:31:06 -0000 1.1
+++ afmt.h 27 Apr 2002 22:42:24 -0000 1.2
@@ -3,6 +3,10 @@
#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h> /* For AFMT_* on linux */
+#else
+#ifdef HAVE_SOUNDCARD_H
+#include <soundcard.h> /* OpenBSD have this instead of <sys/soundcard> */
+#endif
#endif
/* standard, old OSS audio formats */
Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ao_oss.c 22 Apr 2002 22:33:06 -0000 1.21
+++ ao_oss.c 27 Apr 2002 22:42:24 -0000 1.22
@@ -292,9 +292,11 @@
static float get_delay(){
/* Calculate how many bytes/second is sent out */
if(audio_delay_method==2){
+#ifdef SNDCTL_DSP_GETODELAY
int r=0;
if(ioctl(audio_fd, SNDCTL_DSP_GETODELAY, &r)!=-1)
return ((float)r)/(float)ao_data.bps;
+#endif
audio_delay_method=1; // fallback if not supported
}
if(audio_delay_method==1){
Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ao_sun.c 1 Mar 2002 14:54:05 -0000 1.14
+++ ao_sun.c 27 Apr 2002 22:42:24 -0000 1.15
@@ -440,9 +440,11 @@
}
#endif
+#ifndef __OpenBSD__
ioctl(audio_fd, AUDIO_GETINFO, &info);
if (queued_bursts - info.play.eof > 2)
return 0;
+#endif
return ao_data.outburst;
}
@@ -500,9 +502,13 @@
static float get_delay(){
audio_info_t info;
ioctl(audio_fd, AUDIO_GETINFO, &info);
+#ifdef __OpenBSD__
+ return (float) info.play.seek/ (float)byte_per_sec ;
+#else
if (info.play.samples && enable_sample_timing == RTSC_ENABLED)
return (float)(queued_samples - info.play.samples) / (float)byte_per_sec;
else
return (float)((queued_bursts - info.play.eof) * ao_data.outburst) / (float)byte_per_sec;
+#endif
}
More information about the MPlayer-cvslog
mailing list