From eb5bf3b88e11054e30aaa34e713a4a61c167cc04 Mon Sep 17 00:00:00 2001 From: voroshil Date: Thu, 31 May 2007 17:49:51 +0000 Subject: New "automute" tv:// option. Will switch off sound and show blue screen instead of video with noise when signal level (in 0-255 scale) is less than specified value. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23440 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_v4l2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'stream/tvi_v4l2.c') diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index 43656fae01..5646e0d146 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -1321,6 +1321,16 @@ static inline void copy_frame(priv_t *priv, unsigned char *dest, unsigned char * int d = pixfmt2depth(priv->format.fmt.pix.pixelformat); int bytesperline = w*d/8; + if(tv_param_automute>0){ + if (ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) >= 0) { + if(tv_param_automute<<8>priv->tuner.signal){ + fill_blank_frame(dest,bytesperline * h,fcc_vl2mp(priv->format.fmt.pix.pixelformat)); + set_mute(priv,1); + return; + } + } + set_mute(priv,0); + } memcpy(dest, source, bytesperline * h); } -- cgit v1.2.3