[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.49,1.50

Jindrich Makovicka CVS henry at mplayerhq.hu
Wed Jan 1 21:21:48 CET 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv12101

Modified Files:
	tvi_v4l.c 
Log Message:
supress clicks/noise when changing channels

Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- tvi_v4l.c	31 Dec 2002 02:21:28 -0000	1.49
+++ tvi_v4l.c	1 Jan 2003 20:21:45 -0000	1.50
@@ -562,10 +562,12 @@
     pthread_join(priv->video_grabber_thread, NULL);
     mp_msg(MSGT_TV, MSGL_V, "done\n");
 
-    priv->audio[priv->audio_id].volume = 0;
-    priv->audio[priv->audio_id].flags |= VIDEO_AUDIO_MUTE;
-    ioctl(priv->video_fd, VIDIOCSAUDIO, &priv->audio[priv->audio_id]);
-
+    if (priv->capability.audios) {
+	priv->audio[priv->audio_id].volume = 0;
+	priv->audio[priv->audio_id].flags |= VIDEO_AUDIO_MUTE;
+	ioctl(priv->video_fd, VIDIOCSAUDIO, &priv->audio[priv->audio_id]);
+    }
+    
     close(priv->video_fd);
 
     audio_in_uninit(&priv->audio_in);
@@ -941,6 +943,12 @@
 	    /* argument is in MHz ! */
 	    unsigned long freq = (unsigned long)*(void **)arg;
 	    
+	    if (priv->capability.audios) {
+		priv->audio[priv->audio_id].volume = 0;
+		priv->audio[priv->audio_id].flags |= VIDEO_AUDIO_MUTE;
+		ioctl(priv->video_fd, VIDIOCSAUDIO, &priv->audio[priv->audio_id]);
+	    }
+
 	    mp_msg(MSGT_TV, MSGL_V, "requested frequency: %.3f\n", (float)freq/16);
 	    
 	    /* tuner uses khz not mhz ! */
@@ -953,6 +961,13 @@
 		return(TVI_CONTROL_FALSE);
 	    }
 	    usleep(100000); // wait to supress noise during switching
+
+	    if (priv->capability.audios) {
+		priv->audio[priv->audio_id].volume = tv_param_volume;
+		priv->audio[priv->audio_id].flags &= ~VIDEO_AUDIO_MUTE;
+		ioctl(priv->video_fd, VIDIOCSAUDIO, &priv->audio[priv->audio_id]);
+	    }
+
 	    return(TVI_CONTROL_TRUE);
 	}
 	case TVI_CONTROL_TUN_GET_TUNER:



More information about the MPlayer-cvslog mailing list