summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-ext-stream.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-08-20 18:53:26 +0200
committerMichal Ratajsky <[email protected]>2014-08-20 18:53:26 +0200
commit0325b6223a23ebd75fbd8c9244baab00facec126 (patch)
tree8547bdc4a9e875d931eddbeb81e34ec37ddfbfef /backends/pulse/pulse-ext-stream.c
parent9956b2a9465c538c8792235c1ee02d2f90b84641 (diff)
downloadlibmatemixer-0325b6223a23ebd75fbd8c9244baab00facec126.tar.bz2
libmatemixer-0325b6223a23ebd75fbd8c9244baab00facec126.tar.xz
Fix some refcounting and stream control parent setting issues
Diffstat (limited to 'backends/pulse/pulse-ext-stream.c')
-rw-r--r--backends/pulse/pulse-ext-stream.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/backends/pulse/pulse-ext-stream.c b/backends/pulse/pulse-ext-stream.c
index 3e7490a..5d2ec75 100644
--- a/backends/pulse/pulse-ext-stream.c
+++ b/backends/pulse/pulse-ext-stream.c
@@ -274,7 +274,7 @@ pulse_ext_stream_set_stream (MateMixerStreamControl *mmsc, MateMixerStream *mms)
g_return_val_if_fail (PULSE_IS_EXT_STREAM (mmsc), FALSE);
g_return_val_if_fail (mms == NULL || PULSE_IS_STREAM (mms), FALSE);
- fill_ext_stream_restore_info (PULSE_STREAM_CONTROL (mms), &info);
+ fill_ext_stream_restore_info (PULSE_STREAM_CONTROL (mmsc), &info);
if (mms != NULL)
info.device = mate_mixer_stream_get_name (mms);
@@ -331,10 +331,16 @@ fill_ext_stream_restore_info (PulseStreamControl *control,
info->mute = mate_mixer_stream_control_get_mute (mmsc);
map = pulse_stream_control_get_channel_map (control);
- info->channel_map = *map;
+ if G_LIKELY (map != NULL)
+ info->channel_map = *map;
+ else
+ pa_channel_map_init (&info->channel_map);
cvolume = pulse_stream_control_get_cvolume (control);
- info->volume = *cvolume;
+ if G_LIKELY (cvolume != NULL)
+ info->volume = *cvolume;
+ else
+ pa_cvolume_init (&info->volume);
stream = mate_mixer_stream_control_get_stream (mmsc);
if (stream != NULL)