sound: Fix crash when sound device set to NULL

This can occur during transitions.

Introduced in f081264.
This commit is contained in:
Robert Ancell 2019-03-14 11:28:08 +13:00
parent f0812644ae
commit 82ca937ecd

View file

@ -123,7 +123,8 @@ output_device_changed_cb (CcSoundPanel *self)
gtk_widget_set_visible (GTK_WIDGET (self->fade_row), can_fade);
gtk_widget_set_visible (GTK_WIDGET (self->subwoofer_row), has_lfe);
gvc_mixer_control_change_output (self->mixer_control, device);
if (device != NULL)
gvc_mixer_control_change_output (self->mixer_control, device);
}
static void
@ -143,7 +144,8 @@ input_device_changed_cb (CcSoundPanel *self)
cc_volume_slider_set_stream (self->input_volume_slider, stream);
cc_level_bar_set_stream (self->input_level_bar, stream, CC_LEVEL_BAR_STREAM_TYPE_INPUT);
gvc_mixer_control_change_input (self->mixer_control, device);
if (device != NULL)
gvc_mixer_control_change_input (self->mixer_control, device);
}
static void