device-restore: Log invalid sink index while setting formats

This makes it easier to catch errors when using 'pactl set-sink-formats'
This commit is contained in:
Arun Raghavan 2011-08-15 12:07:02 +05:30
parent b9d517cd51
commit 50b420aebd

View file

@ -826,8 +826,10 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
} }
/* Now find our sink */ /* Now find our sink */
if (!(sink = pa_idxset_get_by_index(u->core->sinks, sink_index))) if (!(sink = pa_idxset_get_by_index(u->core->sinks, sink_index))) {
pa_log("Could not find sink #%d", sink_index);
goto fail; goto fail;
}
/* Read or create an entry */ /* Read or create an entry */
name = pa_sprintf_malloc("sink:%s", sink->name); name = pa_sprintf_malloc("sink:%s", sink->name);