[media] tvaudio: fix compiler warnings

This is indeed a bug: balance and volume must be used to set the left and right
channel volume. Fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Hans Verkuil 2011-08-25 10:24:16 -03:00 committed by Mauro Carvalho Chehab
parent 4c04b7a1ad
commit 88af83048d
1 changed files with 6 additions and 3 deletions

View File

@ -1695,14 +1695,17 @@ static int tvaudio_s_ctrl(struct v4l2_subdev *sd,
case V4L2_CID_AUDIO_BALANCE:
{
int volume, balance;
if (!(desc->flags & CHIP_HAS_VOLUME))
break;
volume = max(chip->left,chip->right);
volume = max(chip->left, chip->right);
balance = ctrl->value;
chip->left = (min(65536 - balance, 32768) * volume) / 32768;
chip->right = (min(balance, volume * (__u16)32768)) / 32768;
chip_write(chip,desc->leftreg,desc->volfunc(chip->left));
chip_write(chip,desc->rightreg,desc->volfunc(chip->right));
chip_write(chip, desc->leftreg, desc->volfunc(chip->left));
chip_write(chip, desc->rightreg, desc->volfunc(chip->right));
return 0;
}