*bsd doesn't have info.output_muted - patch by Björn Sandell <biorn@dce.chalmers.se>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7423 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-09-16 19:46:02 +00:00
parent d1b505683a
commit 86349f9208
1 changed files with 4 additions and 2 deletions

View File

@ -279,14 +279,16 @@ static int control(int cmd,int arg){
float volume;
AUDIO_INITINFO(&info);
volume = vol->right > vol->left ? vol->right : vol->left;
info.output_muted = (volume == 0);
if ( !info.output_muted ) {
if ( volume != 0 ) {
info.play.gain = volume * AUDIO_MAX_GAIN / 100;
if ( vol->right == vol->left )
info.play.balance = AUDIO_MID_BALANCE;
else
info.play.balance = (vol->right - vol->left + volume) * AUDIO_RIGHT_BALANCE / (2*volume);
}
#if !defined (__OpenBSD__) && !defined (__NetBSD__)
info.output_muted = (volume == 0);
#endif
ioctl( fd,AUDIO_SETINFO,&info );
close( fd );
return CONTROL_OK;