summaryrefslogtreecommitdiff
path: root/src/pa-sink-ctl.c
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-07-23 00:13:56 +0200
committerben <benjaminfranzke@googlemail.com>2010-07-23 00:13:56 +0200
commitf0fe027dc5e9ed9056c60f3b7300ea0bc8466411 (patch)
treeef773e5fdabf0ad59930bfecc8d20cb868b28f52 /src/pa-sink-ctl.c
parent1a1785595a9079850e1b9d490d486af6c6f47873 (diff)
downloadpa-sink-ctl-f0fe027dc5e9ed9056c60f3b7300ea0bc8466411.tar.gz
pa-sink-ctl-f0fe027dc5e9ed9056c60f3b7300ea0bc8466411.tar.bz2
pa-sink-ctl-f0fe027dc5e9ed9056c60f3b7300ea0bc8466411.zip
sink_list_tmp as userdata instead of global now
Diffstat (limited to 'src/pa-sink-ctl.c')
-rw-r--r--src/pa-sink-ctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c
index ff36be7..23e0dbb 100644
--- a/src/pa-sink-ctl.c
+++ b/src/pa-sink-ctl.c
@@ -10,7 +10,6 @@
#include "pa-sink-ctl.h"
GArray *sink_list = NULL;
-GArray *sink_list_tmp = NULL;
pa_mainloop_api *mainloop_api = NULL;
pa_context *context = NULL;
@@ -105,13 +104,15 @@ void context_state_callback(pa_context *c, gpointer userdata)
*/
void get_sink_info_callback(pa_context *c, const pa_sink_info *i, gint is_last, gpointer userdata)
{
+ GArray *sink_list_tmp = userdata;
+
if (is_last < 0) {
printf("Failed to get sink information: %s\n", pa_strerror(pa_context_errno(c)));
quit();
}
if (is_last) {
- pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL));
+ pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, sink_list_tmp));
return;
}
@@ -132,6 +133,8 @@ void get_sink_info_callback(pa_context *c, const pa_sink_info *i, gint is_last,
*/
void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info *i, gint is_last, gpointer userdata)
{
+ GArray *sink_list_tmp = userdata;
+
if (is_last < 0) {
printf("Failed to get sink input information: %s\n", pa_strerror(pa_context_errno(c)));
return;
@@ -184,7 +187,5 @@ void collect_all_info(void)
if (!info_callbacks_finished)
return;
info_callbacks_finished = FALSE;
-
- sink_list_tmp = sink_list_alloc();
- pa_operation_unref(pa_context_get_sink_info_list(context, get_sink_info_callback, NULL));
+ pa_operation_unref(pa_context_get_sink_info_list(context, get_sink_info_callback, sink_list_alloc()));
}