1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-01 04:12:25 +00:00

supress clicks/noise when changing channels

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8704 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
henry 2003-01-01 20:21:45 +00:00
parent e839ac4f83
commit 1f9abf39b2

View File

@ -562,9 +562,11 @@ static int uninit(priv_t *priv)
pthread_join(priv->video_grabber_thread, NULL);
mp_msg(MSGT_TV, MSGL_V, "done\n");
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);
@ -941,6 +943,12 @@ static int control(priv_t *priv, int cmd, void *arg)
/* 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 @@ static int control(priv_t *priv, int cmd, void *arg)
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: