~ubuntu-branches/ubuntu/oneiric/pavucontrol/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/0002-Handle-noninitialised-data.patch

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2009-04-02 00:21:20 UTC
  • Revision ID: james.westby@ubuntu.com-20090402002120-n1t25pzbz1asgy6y
Tags: 0.9.7-1ubuntu2
0002-Handle-noninitialised-data.patch: Backport from upstream
01e4826b653065268e7a4b8d57e528836e167a23, makes pavucontrol
more robust against LP: #286273.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: pavucontrol-0.9.7/src/pavucontrol.cc
 
2
===================================================================
 
3
--- pavucontrol-0.9.7.orig/src/pavucontrol.cc   2009-04-02 00:19:11.000000000 -0400
 
4
+++ pavucontrol-0.9.7/src/pavucontrol.cc        2009-04-02 00:20:54.000000000 -0400
 
5
@@ -940,7 +940,7 @@
 
6
     info.channel_map.channels = 1;
 
7
     info.channel_map.map[0] = PA_CHANNEL_POSITION_MONO;
 
8
     info.volume = volume;
 
9
-    info.device = device.c_str();
 
10
+    info.device = device == "" ? NULL : device.c_str();
 
11
     info.mute = muteToggleButton->get_active();
 
12
 
 
13
     pa_operation* o;
 
14
@@ -952,7 +952,6 @@
 
15
     pa_operation_unref(o);
 
16
 }
 
17
 
 
18
-
 
19
 /*** MainWindow ***/
 
20
 
 
21
 MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& x) :
 
22
@@ -1428,10 +1427,10 @@
 
23
 
 
24
     eventRoleWidget->updating = true;
 
25
 
 
26
-    eventRoleWidget->device = info.device;
 
27
+    eventRoleWidget->device = info.device ? info.device : "";
 
28
 
 
29
     volume.channels = 1;
 
30
-    volume.values[0] = pa_cvolume_avg(&info.volume);
 
31
+    volume.values[0] = pa_cvolume_max(&info.volume);
 
32
 
 
33
     eventRoleWidget->setVolume(volume);
 
34
     eventRoleWidget->muteToggleButton->set_active(info.mute);