[MPlayer-dev-eng] v4l source: don't mess up volume

Oswald Buddenhagen ossi at kde.org
Sun Feb 1 04:04:13 CET 2004


heya,

the attached patch removes several superflous volume settings - setting
the mute flag should be sufficient. *)
this fixes the major annoyance that every time i start xawtv after
mencoder had run, the volume is zero and i have to manually increase it
again.

i'm not sure that having tv_param_volume -1 is a good default, but one
can't set it to -1 explicitly ... maybe a big fat warning should be
emited if the volume is detected to be (close to) zero.

*) if it's not on some (broken) setups, one could go a different route:
save the current setting and restore it at shutdown.

greetings

-- 
Chaos, panic, and disorder - my work here is done.
-------------- next part --------------
Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.70
diff -U2 -r1.70 tvi_v4l.c
--- tvi_v4l.c	20 Jan 2004 13:32:05 -0000	1.70
+++ tvi_v4l.c	1 Feb 2004 02:58:13 -0000
@@ -333,5 +333,4 @@
 
 	/* mute all channels */
-	priv->audio[i].volume = 0;
 	priv->audio[i].flags |= VIDEO_AUDIO_MUTE;
 	reqmode = -1;
@@ -697,5 +696,4 @@
 
     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]);
@@ -1129,5 +1127,4 @@
 	    
 	    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]);
@@ -1148,5 +1145,4 @@
 
 	    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]);
Index: tv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tv.c,v
retrieving revision 1.65
diff -U2 -r1.65 tv.c
--- tv.c	11 Jan 2004 17:07:32 -0000	1.65
+++ tv.c	1 Feb 2004 02:58:13 -0000
@@ -61,5 +61,5 @@
 #if defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)
 int tv_param_amode = -1;
-int tv_param_volume = 60000;
+int tv_param_volume = -1;
 int tv_param_bass = -1;
 int tv_param_treble = -1;


More information about the MPlayer-dev-eng mailing list