diff --git a/src/context.h b/src/context.h --- a/src/context.h +++ b/src/context.h @@ -96,8 +96,9 @@ newVolume = qBound(0, newVolume, PA_VOLUME_MAX); pa_cvolume newCVolume = cVolume; if (channel == -1) { // -1 all channels + const qint64 diff = newVolume - pa_cvolume_avg(&cVolume); for (int i = 0; i < newCVolume.channels; ++i) { - newCVolume.values[i] = newVolume; + newCVolume.values[i] = qBound(0, newCVolume.values[i] + diff, PA_VOLUME_MAX); } } else { Q_ASSERT(newCVolume.channels > channel); diff --git a/src/volumeobject.cpp b/src/volumeobject.cpp --- a/src/volumeobject.cpp +++ b/src/volumeobject.cpp @@ -38,7 +38,7 @@ qint64 VolumeObject::volume() const { - return m_volume.values[0]; + return pa_cvolume_avg(&m_volume); } bool VolumeObject::isMuted() const