1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed handling relative volume settings in the call to cStatus::MsgSetVolume()

This commit is contained in:
Klaus Schmidinger 2006-07-22 13:26:44 +02:00
parent bd6046c37d
commit 8f3ae72e9d
3 changed files with 9 additions and 2 deletions

View File

@ -1940,3 +1940,7 @@ Antti Hartikainen <ami+vdr@ah.fi>
Patrick Maier <maierp@informatik.tu-muenchen.de> Patrick Maier <maierp@informatik.tu-muenchen.de>
for fixing handling network masks in the svdrphosts.conf file for fixing handling network masks in the svdrphosts.conf file
Norbert Wentz <norbert.wentz@online.de>
for reporting a bug in handling relative volume settings in the call to
cStatus::MsgSetVolume()

View File

@ -4820,3 +4820,5 @@ Video Disk Recorder Revision History
after all other fixes, because a short text might become a description. after all other fixes, because a short text might become a description.
- Fixed handling network masks in the svdrphosts.conf file (thanks to Patrick - Fixed handling network masks in the svdrphosts.conf file (thanks to Patrick
Maier). Maier).
- Fixed handling relative volume settings in the call to cStatus::MsgSetVolume()
(reported by Norbert Wentz).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 1.131 2006/06/15 09:59:40 kls Exp $ * $Id: device.c 1.132 2006/07/22 13:18:34 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -776,9 +776,10 @@ void cDevice::SetAudioChannel(int AudioChannel)
void cDevice::SetVolume(int Volume, bool Absolute) void cDevice::SetVolume(int Volume, bool Absolute)
{ {
int OldVolume = volume;
volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME); volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME);
SetVolumeDevice(volume); SetVolumeDevice(volume);
cStatus::MsgSetVolume(volume, Absolute); cStatus::MsgSetVolume(Absolute ? volume : volume - OldVolume, Absolute);
if (volume > 0) { if (volume > 0) {
mute = false; mute = false;
Audios.MuteAudio(mute); Audios.MuteAudio(mute);