diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-26 18:21:30 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-26 18:21:30 -0200 |
commit | fc1f956eca9a6e77bd988271fe023dd49ea12d34 (patch) | |
tree | 06e46c51b3763aaf909581ff2946acd5c446487e /linux/drivers/media/video/bt8xx/bttv-driver.c | |
parent | 6931c49714b2a66d311fd0ddce8aaa7ee48c94fd (diff) | |
download | mediapointer-dvb-s2-fc1f956eca9a6e77bd988271fe023dd49ea12d34.tar.gz mediapointer-dvb-s2-fc1f956eca9a6e77bd988271fe023dd49ea12d34.tar.bz2 |
Restructurize volume hook and drop unused mute hook.
From: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---
linux/drivers/media/video/bt8xx/bttv-audio-hook.c | 29 +++++++++-----------
linux/drivers/media/video/bt8xx/bttv-driver.c | 31 ++--------------------
2 files changed, 17 insertions(+), 43 deletions(-)
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 7179f2d54..e3f53a721 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -1475,23 +1475,13 @@ static void bttv_reinit_bt848(struct bttv *btv) static int get_control(struct bttv *btv, struct v4l2_control *c) { - int i; - - for (i = 0; i < BTTV_CTLS; i++) - if (bttv_ctls[i].id == c->id) - break; - if (i == BTTV_CTLS) - return -EINVAL; #ifdef CONFIG_VIDEO_V4L1 - if (btv->audio_hook && i >= 4 && i <= 8) { + if (btv->audio_hook && (c->id == V4L2_CID_AUDIO_VOLUME)) { struct video_audio va; memset(&va,0,sizeof(va)); btv->audio_hook(btv,&va,0); switch (c->id) { - case V4L2_CID_AUDIO_MUTE: - c->value = (VIDEO_AUDIO_MUTE & va.flags) ? 1 : 0; - break; case V4L2_CID_AUDIO_VOLUME: c->value = va.volume; break; @@ -1562,30 +1552,15 @@ static int get_control(struct bttv *btv, struct v4l2_control *c) static int set_control(struct bttv *btv, struct v4l2_control *c) { - int i,val; + int val; - for (i = 0; i < BTTV_CTLS; i++) - if (bttv_ctls[i].id == c->id) - break; - if (i == BTTV_CTLS) - return -EINVAL; #ifdef CONFIG_VIDEO_V4L1 - if (btv->audio_hook && i >= 4 && i <= 8) { + if (btv->audio_hook && (c->id == V4L2_CID_AUDIO_VOLUME)) { struct video_audio va; memset(&va,0,sizeof(va)); btv->audio_hook(btv,&va,0); switch (c->id) { - case V4L2_CID_AUDIO_MUTE: - if (c->value) { - va.flags |= VIDEO_AUDIO_MUTE; - audio_mute(btv, 1); - } else { - va.flags &= ~VIDEO_AUDIO_MUTE; - audio_mute(btv, 0); - } - break; - case V4L2_CID_AUDIO_VOLUME: va.volume = c->value; break; |