diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-02-04 18:40:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-02-04 18:40:12 +0100 |
commit | 01e4826b653065268e7a4b8d57e528836e167a23 (patch) | |
tree | 7b8d33dd6d241f265d93c2f745bf77c67d83b08d /src/pavucontrol.cc | |
parent | 1ad5143d150795e3fecc847093b66811e2731612 (diff) |
deal with non-initialized data from m-s-r
Diffstat (limited to 'src/pavucontrol.cc')
-rw-r--r-- | src/pavucontrol.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index d42c9d7..2bf3463 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -932,7 +932,7 @@ void RoleWidget::executeVolumeUpdate() { info.channel_map.channels = 1; info.channel_map.map[0] = PA_CHANNEL_POSITION_MONO; info.volume = volume; - info.device = device.c_str(); + info.device = device == "" ? NULL : device.c_str(); info.mute = muteToggleButton->get_active(); pa_operation* o; @@ -944,7 +944,6 @@ void RoleWidget::executeVolumeUpdate() { pa_operation_unref(o); } - /*** MainWindow ***/ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& x) : @@ -1420,10 +1419,10 @@ void MainWindow::updateRole(const pa_ext_stream_restore_info &info) { eventRoleWidget->updating = true; - eventRoleWidget->device = info.device; + eventRoleWidget->device = info.device ? info.device : ""; volume.channels = 1; - volume.values[0] = pa_cvolume_avg(&info.volume); + volume.values[0] = pa_cvolume_max(&info.volume); eventRoleWidget->setVolume(volume); eventRoleWidget->muteToggleButton->set_active(info.mute); |