Merge lp:~kaijanmaki/indicator-sound/lp-850662 into lp:indicator-sound/fourth

Proposed by Antti Kaijanmäki
Status: Merged
Approved by: Ted Gould
Approved revision: 274
Merged at revision: 274
Proposed branch: lp:~kaijanmaki/indicator-sound/lp-850662
Merge into: lp:indicator-sound/fourth
Diff against target: 36 lines (+12/-0)
1 file modified
src/pulseaudio-mgr.c (+12/-0)
To merge this branch: bzr merge lp:~kaijanmaki/indicator-sound/lp-850662
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+78817@code.launchpad.net

Description of the change

Please, review my fix for #850662. (this time agains right branch..)

PulseAudio indices are unsigned integers.
indicator-sound uses gint internally.

I noticed with GDB that the index value is set -1 when PA dies. Without the
fix PA functions are called with invalid indices.

I suspect that the true problem behind SIGABRT is that the pa_context is in
some broken state due to PA dying and passing it to any pa-function would
probably lead to a crash. Didn't investigate this further as checking the
index is enough to prevent the call to pa-functions.

To post a comment you must log in.
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

I tested the patch by attaching to the indicator-sound-service with GDB and then killing pulseaudio and clicking the indicator when PA was down. Everything worked great and no regression noticed on my side.

Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pulseaudio-mgr.c'
2--- src/pulseaudio-mgr.c 2011-03-24 15:22:30 +0000
3+++ src/pulseaudio-mgr.c 2011-10-10 11:27:26 +0000
4@@ -174,6 +174,10 @@
5 void
6 pm_update_volume (gint sink_index, pa_cvolume new_volume)
7 {
8+ // LP: #850662
9+ if (sink_index < 0){
10+ return;
11+ }
12 pa_operation_unref (pa_context_set_sink_volume_by_index (pulse_context,
13 sink_index,
14 &new_volume,
15@@ -192,6 +196,10 @@
16 void
17 pm_update_mic_gain (gint source_index, pa_cvolume new_gain)
18 {
19+ // LP: #850662
20+ if (source_index < 0){
21+ return;
22+ }
23 pa_operation_unref (pa_context_set_source_volume_by_index (pulse_context,
24 source_index,
25 &new_gain,
26@@ -202,6 +210,10 @@
27 void
28 pm_update_mic_mute (gint source_index, gint mute_update)
29 {
30+ // LP: #850662
31+ if (source_index < 0){
32+ return;
33+ }
34 pa_operation_unref (pa_context_set_source_mute_by_index (pulse_context,
35 source_index,
36 mute_update,

Subscribers

People subscribed via source and target branches