diff options
author | Michal Ratajsky <[email protected]> | 2016-01-04 20:31:14 +0100 |
---|---|---|
committer | Michal Ratajsky <[email protected]> | 2016-01-04 20:31:14 +0100 |
commit | 9772797c31ebed2417b42a9389caae1b16847e86 (patch) | |
tree | 0257271d6f8387ce89984bf8341b11186381c8d5 /backends/pulse/pulse-source.c | |
parent | d32ca3f420d036cd750fc1aad7f95da40559cc5d (diff) | |
download | libmatemixer-9772797c31ebed2417b42a9389caae1b16847e86.tar.bz2 libmatemixer-9772797c31ebed2417b42a9389caae1b16847e86.tar.xz |
Improve error checking in many places
Diffstat (limited to 'backends/pulse/pulse-source.c')
-rw-r--r-- | backends/pulse/pulse-source.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/backends/pulse/pulse-source.c b/backends/pulse/pulse-source.c index acba188..570423d 100644 --- a/backends/pulse/pulse-source.c +++ b/backends/pulse/pulse-source.c @@ -127,6 +127,7 @@ pulse_source_new (PulseConnection *connection, g_return_val_if_fail (PULSE_IS_CONNECTION (connection), NULL); g_return_val_if_fail (info != NULL, NULL); + g_return_val_if_fail (device == NULL || PULSE_IS_DEVICE (device), NULL); source = g_object_new (PULSE_TYPE_SOURCE, "name", info->name, @@ -186,6 +187,9 @@ pulse_source_add_output (PulseSource *source, const pa_source_output_info *info) { PulseSourceOutput *output; + g_return_val_if_fail (PULSE_IS_SOURCE (source), FALSE); + g_return_val_if_fail (info != NULL, FALSE); + /* This function is used for both creating and refreshing source outputs */ output = g_hash_table_lookup (source->priv->outputs, GUINT_TO_POINTER (info->index)); if (output == NULL) { @@ -215,6 +219,8 @@ pulse_source_remove_output (PulseSource *source, guint32 index) PulseSourceOutput *output; gchar *name; + g_return_if_fail (PULSE_IS_SOURCE (source)); + output = g_hash_table_lookup (source->priv->outputs, GUINT_TO_POINTER (index)); if G_UNLIKELY (output == NULL) return; |