[MPlayer-dev-eng] [PATCH] bsdbt848 fixes

Bernd Ernesti mplayer at lists.veego.de
Mon Feb 23 22:14:56 CET 2004


Hi,

I finally found the time to test mplayer with my bt848 card and had some
problems with it. The wrong audio device on NetBSD and then it didn't
display anything so i was searching via google and found the following
link:

http://www.freebsd.org/cgi/query-pr.cgi?pr=59946

So, attached is a patch which fix the audio device problem and incoperates
the freebsd patch.

Bernd

-------------- next part --------------
--- libmpdemux/tvi_bsdbt848.c	2004-01-08 08:16:35.000000000 +0100
+++ libmpdemux/tvi_bsdbt848.c	2004-02-23 22:04:28.000000000 +0100
@@ -292,6 +292,7 @@
 
     case TVI_CONTROL_TUN_SET_NORM:
         {
+	u_short tmp_fps;
         int req_mode = (int)*(void **)arg;
 
         priv->iformat = METEOR_FMT_AUTOMODE;
@@ -357,12 +358,20 @@
             return(0);
             }
 
-        if(ioctl(priv->btfd, METEORSFPS, &priv->fps) < 0) 
+	tmp_fps=priv->fps;
+	if(ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
             {
             perror("fps:ioctl");
             return(0);
             }
+	//set audioid after norm has been set    
+	if(priv->tunerready == TRUE &&
+	    ioctl(priv->tunerfd,BT848_SAUDIO, &tv_param_audio_id)<0)
+	    {
+		perror("Unable to set audioid");
+	    }
 
+/*
 #ifdef BT848_SAUDIO
 	if((priv->tunerready == TRUE) &&
 	    ioctl(priv->btfd, BT848_SAUDIO, &tv_param_audio_id) < 0)
@@ -370,6 +379,7 @@
 	    perror("audioid:ioctl");
 	    }
 #endif
+*/
 
         return(TVI_CONTROL_TRUE);
         }
@@ -466,6 +476,7 @@
 {
 int marg;
 int count;
+u_short tmp_fps;
 
 G_private = priv; /* Oooh, sick */
 
@@ -510,8 +521,9 @@
     perror("SINPUT:ioctl");
     }
 
+tmp_fps=priv->fps;
 if(priv->videoready == TRUE &&
-   ioctl(priv->btfd, METEORSFPS, &priv->fps) < 0) 
+   ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0) 
     {
     perror("SFPS:ioctl");
     }
@@ -567,7 +579,11 @@
 /* Audio Configuration */
 
 priv->dspready = TRUE;
+#ifdef __NetBSD__
+priv->dspdev = strdup("/dev/sound");
+#else
 priv->dspdev = strdup("/dev/dsp");
+#endif
 priv->dspsamplesize = 16;
 priv->dspstereo = 1;
 priv->dspspeed = 44100;
@@ -577,9 +593,9 @@
 priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps * 
                      (priv->dspstereo+1);
 
-if((priv->dspfd = open ("/dev/dsp", O_RDONLY, 0)) < 0)
+if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) < 0)
     {
-    perror("/dev/dsp open");
+    perror("dsp open");
     priv->dspready = FALSE;
     } 
 
@@ -597,7 +613,7 @@
    (ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &priv->dspspeed) == -1) ||
    (ioctl(priv->dspfd, SNDCTL_DSP_SETFMT, &priv->dspfmt) == -1)))
     {
-    perror ("configuration of /dev/dsp failed");
+    perror ("configuration of dsp failed");
     close(priv->dspfd);
     priv->dspready = FALSE;
     }


More information about the MPlayer-dev-eng mailing list