diff options
author | jkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-12 16:59:11 +0000 |
---|---|---|
committer | jkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-12 16:59:11 +0000 |
commit | a019c0dd3d621c428fbf5c9d54bd9ad7f6425302 (patch) | |
tree | ea6567963537a539b9582316a6486dd14453e3d8 /libao2/ao_sun.c | |
parent | dbe6de1995b8901b4fb3ca0082d336df393e4633 (diff) | |
download | mpv-a019c0dd3d621c428fbf5c9d54bd9ad7f6425302.tar.bz2 mpv-a019c0dd3d621c428fbf5c9d54bd9ad7f6425302.tar.xz |
Reconstruct the muting state for the playback from a l/r volume of 0.0.
This way the sound card is really silent, when the mute state is toggled in
gmplayer.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7380 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_sun.c')
-rw-r--r-- | libao2/ao_sun.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c index d5c54280d0..0a6e6979c8 100644 --- a/libao2/ao_sun.c +++ b/libao2/ao_sun.c @@ -279,11 +279,14 @@ static int control(int cmd,int arg){ float volume; AUDIO_INITINFO(&info); volume = vol->right > vol->left ? vol->right : vol->left; - 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); + info.output_muted = (volume == 0); + if ( !info.output_muted ) { + 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); + } ioctl( fd,AUDIO_SETINFO,&info ); close( fd ); return CONTROL_OK; |