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
=== modified file 'src/pulseaudio-mgr.c'
--- src/pulseaudio-mgr.c 2011-03-24 15:22:30 +0000
+++ src/pulseaudio-mgr.c 2011-10-10 11:27:26 +0000
@@ -174,6 +174,10 @@
174void174void
175pm_update_volume (gint sink_index, pa_cvolume new_volume)175pm_update_volume (gint sink_index, pa_cvolume new_volume)
176{176{
177 // LP: #850662
178 if (sink_index < 0){
179 return;
180 }
177 pa_operation_unref (pa_context_set_sink_volume_by_index (pulse_context,181 pa_operation_unref (pa_context_set_sink_volume_by_index (pulse_context,
178 sink_index,182 sink_index,
179 &new_volume,183 &new_volume,
@@ -192,6 +196,10 @@
192void196void
193pm_update_mic_gain (gint source_index, pa_cvolume new_gain)197pm_update_mic_gain (gint source_index, pa_cvolume new_gain)
194{198{
199 // LP: #850662
200 if (source_index < 0){
201 return;
202 }
195 pa_operation_unref (pa_context_set_source_volume_by_index (pulse_context,203 pa_operation_unref (pa_context_set_source_volume_by_index (pulse_context,
196 source_index,204 source_index,
197 &new_gain,205 &new_gain,
@@ -202,6 +210,10 @@
202void210void
203pm_update_mic_mute (gint source_index, gint mute_update)211pm_update_mic_mute (gint source_index, gint mute_update)
204{212{
213 // LP: #850662
214 if (source_index < 0){
215 return;
216 }
205 pa_operation_unref (pa_context_set_source_mute_by_index (pulse_context,217 pa_operation_unref (pa_context_set_source_mute_by_index (pulse_context,
206 source_index,218 source_index,
207 mute_update,219 mute_update,

Subscribers

People subscribed via source and target branches