int watch_stereo:1;
};
-#define MIN(a,b) (((a)>(b))?(b):(a))
-#define MAX(a,b) (((a)>(b))?(a):(b))
#define HAVE_NICAM(msp) (((msp->rev2>>8) & 0xff) != 00)
#define HAVE_SIMPLE(msp) ((msp->rev1 & 0xff) >= 'D'-'@')
#define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
return 0;
case V4L2_CID_AUDIO_BALANCE:
{
- int volume = MAX(msp->left, msp->right);
+ int volume = max(msp->left, msp->right);
- ctrl->value = (32768 * MIN(msp->left, msp->right)) /
+ ctrl->value = (32768 * min(msp->left, msp->right)) /
(volume ? volume : 1);
ctrl->value = (msp->left < msp->right) ?
(65535 - ctrl->value) : ctrl->value;
ctrl->value = msp->treble;
return 0;
case V4L2_CID_AUDIO_VOLUME:
- ctrl->value = MAX(msp->left, msp->right);
+ ctrl->value = max(msp->left, msp->right);
return 0;
default:
return -EINVAL;
return 0;
case V4L2_CID_AUDIO_BALANCE:
balance=ctrl->value;
- volume = MAX(msp->left, msp->right);
+ volume = max(msp->left, msp->right);
set_volume=1;
break;
case V4L2_CID_AUDIO_BASS:
msp3400c_settreble(client, msp->treble);
return 0;
case V4L2_CID_AUDIO_VOLUME:
- volume = MAX(msp->left, msp->right);
+ volume = max(msp->left, msp->right);
- balance = (32768 * MIN(msp->left, msp->right)) /
+ balance = (32768 * min(msp->left, msp->right)) /
(volume ? volume : 1);
balance = (msp->left < msp->right) ?
(65535 - balance) : balance;
}
if (set_volume) {
- msp->left = (MIN(65536 - balance, 32768) * volume) / 32768;
- msp->right = (MIN(balance, 32768) * volume) / 32768;
+ msp->left = (min(65536 - balance, 32768) * volume) / 32768;
+ msp->right = (min(balance, 32768) * volume) / 32768;
msp3400_dbg("volume=%d, balance=%d, left=%d, right=%d",
volume,balance,msp->left,msp->right);
if (msp->muted)
va->flags |= VIDEO_AUDIO_MUTE;
- va->volume = MAX(msp->left, msp->right);
- va->balance = (32768 * MIN(msp->left, msp->right)) /
+ va->volume = max(msp->left, msp->right);
+ va->balance = (32768 * min(msp->left, msp->right)) /
(va->volume ? va->volume : 1);
va->balance = (msp->left < msp->right) ?
(65535 - va->balance) : va->balance;
msp3400_dbg("VIDIOCSAUDIO\n");
msp->muted = (va->flags & VIDEO_AUDIO_MUTE);
- msp->left = (MIN(65536 - va->balance, 32768) *
+ msp->left = (min(65536 - va->balance, 32768) *
va->volume) / 32768;
- msp->right = (MIN(va->balance, 32768) * va->volume) / 32768;
+ msp->right = (min((int)va->balance, 32768) * va->volume) / 32768;
msp->bass = va->bass;
msp->treble = va->treble;
msp3400_dbg("VIDIOCSAUDIO setting va->volume to %d\n",