diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-10-01 12:20:04 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2010-11-23 17:10:25 +0100 |
commit | 8a09745b8c73a1bc292ebe56b0f1baba5afda5a8 (patch) | |
tree | 577ac8808c46c4c23470292416ae35647086a6b9 /gtk/spice-pulse.c | |
parent | 80817885eb93355ededfceff8fcb8f7f554536fb (diff) |
make spice_session_get_channels return a glist
Diffstat (limited to 'gtk/spice-pulse.c')
-rw-r--r-- | gtk/spice-pulse.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c index 7c363f1..26e7496 100644 --- a/gtk/spice-pulse.c +++ b/gtk/spice-pulse.c @@ -161,8 +161,7 @@ SpicePulse *spice_pulse_new(SpiceSession *session, GMainLoop *mainloop, { SpicePulse *pulse; spice_pulse *p; - SpiceChannel *channels[16]; - int i, n; + GList *list; pulse = g_object_new(SPICE_TYPE_PULSE, NULL); p = SPICE_PULSE_GET_PRIVATE(pulse); @@ -170,10 +169,11 @@ SpicePulse *spice_pulse_new(SpiceSession *session, GMainLoop *mainloop, g_signal_connect(session, "spice-session-channel-new", G_CALLBACK(channel_new), pulse); - n = spice_session_get_channels(session, channels, SPICE_N_ELEMENTS(channels)); - for (i = 0; i < n; i++) { - channel_new(session, channels[i], (gpointer*)pulse); + list = spice_session_get_channels(session); + for (list = g_list_first(list); list != NULL; list = g_list_next(list)) { + channel_new(session, list->data, (gpointer*)pulse); } + g_list_free(list); p->mainloop = pa_glib_mainloop_new(g_main_loop_get_context(mainloop)); p->context = pa_context_new(pa_glib_mainloop_get_api(p->mainloop), name); |