[MPlayer-cvslog] r22952 - in trunk: configure stream/tvi_bsdbt848.c

voroshil subversion at mplayerhq.hu
Mon Apr 9 15:18:06 CEST 2007


Author: voroshil
Date: Mon Apr  9 15:18:06 2007
New Revision: 22952

Modified:
   trunk/configure
   trunk/stream/tvi_bsdbt848.c

Log:
remove ugly #include from tvi_bsdbt848.c
(better detection of bt848 headers)


Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Mon Apr  9 15:18:06 2007
@@ -6676,18 +6676,80 @@ echores "$_tv"
 
 
 if bsd; then
+echocheck "*BSD BT848 bt8xx header"
+_ioctl_bt848_h=no
+for file in "machine/ioctl_bt848.h" \
+            "dev/bktr/ioctl_bt848.h" \
+            "dev/video/bktr/ioctl_bt848.h" \
+            "dev/ic/bt8xx.h" ; do
+    cat > $TMPC <<EOF
+#include <sys/types.h>
+#include <$file>
+int main(void) {
+ ioctl(0, TVTUNER_GETFREQ, 0);
+ return 0;
+}
+EOF
+    if cc_check ; then
+     _ioctl_bt848_h=yes
+     _ioctl_bt848_h_name="$file"
+     break;
+    fi
+done
+if test "$_ioctl_bt848_h" = yes ; then
+  _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
+  _res_comment="using $_ioctl_bt848_h_name"
+else
+  _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
+fi
+echores "$_ioctl_bt848_h"
+
+echocheck "*BSD ioctl_meteor.h"
+_ioctl_meteor_h=no
+for file in "machine/ioctl_meteor.h" \
+            "dev/bktr/ioctl_meteor.h" \
+            "dev/video/bktr/ioctl_meteor.h" ; do
+    cat > $TMPC <<EOF
+#include <sys/types.h>
+#include <$file>
+int main(void) { 
+ ioctl(0, METEORSINPUT, 0);
+ return 0; 
+}
+EOF
+    if cc_check ; then
+     _ioctl_meteor_h=yes
+     _ioctl_meteor_h_name="$file"
+     break;
+    fi
+done
+if test "$_ioctl_meteor_h" = yes ; then
+  _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
+  _res_comment="using $_ioctl_meteor_h_name"
+else
+  _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
+fi
+echores "$_ioctl_meteor_h"
+
 echocheck "*BSD BrookTree 848 TV interface"
 if test "$_tv_bsdbt848" = auto ; then
  _tv_bsdbt848=no
  if test "$_tv" = yes ; then
     cat > $TMPC <<EOF
 #include <sys/types.h>
-#if defined(__NetBSD__)
-#include <dev/ic/bt8xx.h>
-#else
-#include <machine/ioctl_bt848.h>
+$_def_ioctl_meteor_h_name
+$_def_ioctl_bt848_h_name
+#ifdef IOCTL_METEOR_H_NAME
+#include IOCTL_METEOR_H_NAME
 #endif
-int main(void) { return 0; }
+#ifdef IOCTL_BT848_H_NAME
+#include IOCTL_BT848_H_NAME
+#endif
+int main(void){
+ ioctl(0, METEORSINPUT, 0);
+ ioctl(0, TVTUNER_GETFREQ, 0);
+ return 0; 
+}
 EOF
     cc_check && _tv_bsdbt848=yes
  fi
@@ -8095,6 +8157,10 @@ $_def_tv_v4l1
 /* Enable Video 4 Linux 2 TV interface support */
 $_def_tv_v4l2
 
+/* *BSD BrookTree headers */
+$_def_ioctl_meteor_h_name
+$_def_ioctl_bt848_h_name
+
 /* Enable *BSD BrookTree TV interface support */
 $_def_tv_bsdbt848
 

Modified: trunk/stream/tvi_bsdbt848.c
==============================================================================
--- trunk/stream/tvi_bsdbt848.c	(original)
+++ trunk/stream/tvi_bsdbt848.c	Mon Apr  9 15:18:06 2007
@@ -38,18 +38,16 @@
 #include <string.h>
 
 #include <sys/param.h>
-#ifdef __NetBSD__
-#include <dev/ic/bt8xx.h>
+#ifdef USE_SUN_AUDIO
 #include <sys/audioio.h>
-#elif defined(__DragonFly__)
-#include <dev/video/meteor/ioctl_meteor.h>
-#include <dev/video/bktr/ioctl_bt848.h>
-#elif (__FreeBSD_version >= 502100) || defined(__FreeBSD_kernel__)
-#include <dev/bktr/ioctl_meteor.h>
-#include <dev/bktr/ioctl_bt848.h>
-#else
-#include <machine/ioctl_meteor.h>
-#include <machine/ioctl_bt848.h>
+#endif
+
+#ifdef IOCTL_METEOR_H_NAME
+#include IOCTL_METEOR_H_NAME
+#endif
+
+#ifdef IOCTL_BT848_H_NAME
+#include IOCTL_BT848_H_NAME
 #endif
 
 #ifdef HAVE_SYS_SOUNDCARD_H
@@ -204,7 +202,7 @@ static tvi_handle_t *tvi_init_bsdbt848(c
 
     /* set audio device name */
     if (!adevice)
-#ifdef __NetBSD__
+#ifdef USE_SUN_AUDIO
         priv->dspdev = strdup("/dev/sound");
 #else
         priv->dspdev = strdup("/dev/dsp");
@@ -834,13 +832,13 @@ return(priv->dspbytesread * 1.0 / priv->
 static int get_audio_framesize(priv_t *priv)
 {
 int bytesavail;
-#ifdef __NetBSD__
+#ifdef USE_SUN_AUDIO
 struct audio_info auinf;
 #endif
 
 if(priv->dspready == FALSE) return 0;
 
-#ifdef __NetBSD__
+#ifdef USE_SUN_AUDIO
 if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0) 
     {
     perror("AUDIO_GETINFO");



More information about the MPlayer-cvslog mailing list