summaryrefslogtreecommitdiffstats
path: root/stream/tvi_v4l2.c
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-31 17:49:51 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-31 17:49:51 +0000
commiteb5bf3b88e11054e30aaa34e713a4a61c167cc04 (patch)
tree61f2407f803d6bbb47f724b4fe14f6652f2dfc79 /stream/tvi_v4l2.c
parentd244fffa741baa4757c5385e53c93cee4224d599 (diff)
downloadmpv-eb5bf3b88e11054e30aaa34e713a4a61c167cc04.tar.bz2
mpv-eb5bf3b88e11054e30aaa34e713a4a61c167cc04.tar.xz
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
Diffstat (limited to 'stream/tvi_v4l2.c')
-rw-r--r--stream/tvi_v4l2.c10
1 files changed, 10 insertions, 0 deletions
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);
}