summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'backends/pulse/pulse-sink.c')
-rw-r--r--backends/pulse/pulse-sink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/backends/pulse/pulse-sink.c b/backends/pulse/pulse-sink.c
index 294643c..616331b 100644
--- a/backends/pulse/pulse-sink.c
+++ b/backends/pulse/pulse-sink.c
@@ -130,6 +130,7 @@ pulse_sink_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);
sink = g_object_new (PULSE_TYPE_SINK,
"name", info->name,
@@ -189,6 +190,9 @@ pulse_sink_add_input (PulseSink *sink, const pa_sink_input_info *info)
{
PulseSinkInput *input;
+ g_return_val_if_fail (PULSE_IS_SINK (sink), FALSE);
+ g_return_val_if_fail (info != NULL, FALSE);
+
/* This function is used for both creating and refreshing sink inputs */
input = g_hash_table_lookup (sink->priv->inputs, GUINT_TO_POINTER (info->index));
if (input == NULL) {
@@ -218,6 +222,8 @@ pulse_sink_remove_input (PulseSink *sink, guint32 index)
PulseSinkInput *input;
gchar *name;
+ g_return_if_fail (PULSE_IS_SINK (sink));
+
input = g_hash_table_lookup (sink->priv->inputs, GUINT_TO_POINTER (index));
if G_UNLIKELY (input == NULL)
return;