Merge lp:~cjcurran/indicator-sound/hotplug-client-index-fix into lp:~harryhaaren/indicator-sound/hotplug-client-index

Proposed by Conor Curran
Status: Merged
Merge reported by: Conor Curran
Merged at revision: not available
Proposed branch: lp:~cjcurran/indicator-sound/hotplug-client-index-fix
Merge into: lp:~harryhaaren/indicator-sound/hotplug-client-index
Diff against target: 84 lines (+48/-0) (has conflicts)
1 file modified
src/pulseaudio-mgr.c (+48/-0)
Text conflict in src/pulseaudio-mgr.c
To merge this branch: bzr merge lp:~cjcurran/indicator-sound/hotplug-client-index-fix
Reviewer Review Type Date Requested Status
Harry van Haaren Pending
Review via email: mp+66140@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pulseaudio-mgr.c'
2--- src/pulseaudio-mgr.c 2011-06-27 16:58:31 +0000
3+++ src/pulseaudio-mgr.c 2011-06-28 13:12:45 +0000
4@@ -109,10 +109,15 @@
5 static pa_context *pulse_context = NULL;
6 static pa_glib_mainloop *pa_main_loop = NULL;
7
8+<<<<<<< TREE
9 static GHashTable *client_index_to_sink_index_hash = NULL;
10 static GHashTable *sink_input_index_to_sink_index_hash = NULL;
11
12 static gboolean auto_stream_change_new_hardware_detected = FALSE;
13+=======
14+static GHashTable *client_index_to_sink_index_hash = NULL;
15+static GHashTable *sink_input_index_to_sink_index_hash = NULL;
16+>>>>>>> MERGE-SOURCE
17
18 /**
19 Entry Point
20@@ -629,6 +634,7 @@
21 }
22
23 printf("SinkInput: %i\tClientIndex: %i\t SinkIndex: %i\n", info->index, info->client, info->sink);
24+<<<<<<< TREE
25 }
26
27
28@@ -729,6 +735,43 @@
29 info,
30 eol,
31 userdata);
32+=======
33+
34+
35+ // Sink input change: check if the (client_index == old_client_index &&
36+ // sink_input == old_sink_input &&
37+ // sink_index != old_sink_index)
38+ // if that condition is true, we have the same stream (client & sink_input)
39+ // playing back on a different output (sink).
40+
41+ gint client_index = (gint)info->client;
42+ gint sink_input = (gint)info->index;
43+ gint sink_index = (gint)info->sink;
44+
45+ gint old_sink_index_from_client = -1;
46+ gint old_sink_index_from_sink_input = -1;
47+
48+ // get current client number's sink_index from table. Not found = new client number?
49+ g_debug ("here 1 %i", client_index_to_sink_index_hash == NULL);
50+ gpointer old_sink_index_pointer_from_client = g_hash_table_lookup(client_index_to_sink_index_hash, GINT_TO_POINTER(client_index));
51+ g_debug ("here 2");
52+
53+ if (old_sink_index_pointer_from_client != NULL){
54+ old_sink_index_from_client = GPOINTER_TO_INT (old_sink_index_pointer_from_client);
55+ }
56+
57+
58+ gpointer old_sink_index_pointer_from_sink_input = g_hash_table_lookup(sink_input_index_to_sink_index_hash, GINT_TO_POINTER (sink_input));
59+
60+ if (old_sink_index_pointer_from_sink_input != NULL){
61+ old_sink_index_from_sink_input = GPOINTER_TO_INT (old_sink_index_pointer_from_sink_input);
62+ }
63+
64+ if ( old_sink_index_from_client == old_sink_index_from_sink_input )
65+ {
66+ // we have a stream switch
67+ g_debug("\tSTREAM SWITCH!\n");
68+>>>>>>> MERGE-SOURCE
69
70 // Get information about a client by its index.
71 pa_context_get_client_info (c, client_index, pm_get_client_name_callback, userdata);
72@@ -764,8 +807,13 @@
73 gint sink_input = (gint)info->index;
74
75 // store client index, sink index and sink input index
76+<<<<<<< TREE
77 //g_hash_table_insert( client_index_to_sink_index_hash, GINT_TO_POINTER(client), GINT_TO_POINTER(sink));
78 g_hash_table_insert( sink_input_index_to_sink_index_hash, GINT_TO_POINTER(sink_input), GINT_TO_POINTER(sink));
79+=======
80+ g_hash_table_insert( client_index_to_sink_index_hash, GINT_TO_POINTER(client), GINT_TO_POINTER(sink));
81+ g_hash_table_insert( sink_input_index_to_sink_index_hash, GINT_TO_POINTER(sink_input), GINT_TO_POINTER(sink));
82+>>>>>>> MERGE-SOURCE
83
84 }
85

Subscribers

People subscribed via source and target branches

to all changes: