Hi folks,<br><br>I have made considerable progress from earlier on. I have almost completed my task but it looks as if there may be a bug or more than likely I'm being a bit stupid ?<br><br>I'm on 0.9.1.4 on Jaunty. <br>
<br>Scenario:<br><br>On a PA_SUBSCRIPTION_EVENT_SINK_INPUT my subscription callback method is called with the relevant userdata obj which was passed in at the main method stage. All fine so far. <br><br>After receiving this event, I then call <br>
<br>pa_context_get_sink_input_info(c, index, context_get_sink_input_info_callback, userdata)); //please note at this point the userdata obj is as it should be.<br><br>But when the callback is called the userdata obj is NULL ! <br>
<br>Any ideas ?<br><br>Code is pasted below<br><br>Conor<br><br>static void context_get_sink_input_info_callback(pa_context *c, const pa_sink_input_info *info, void *userdata){<br> if (!info) {<br> printf("Failed to get sink input info");<br>
return;<br> }<br> else{<br> printf("\n SINK INPUT INFO Name : %s \n", info->name);<br> printf("\n SINK INPUT INFO sink index : %d \n", info->sink);<br> pa_operation_unref(pa_context_get_sink_info_by_index(c, info->sink, context_get_sink_info_by_index_callback, userdata));<br>
<br> // From here userdata is NULL !<br> if (userdata == NULL) {<br> printf("userdata is null in the events callback");<br> }<br> else{<br> update_GUI((GtkLabel*)userdata);<br>
}<br> }<br>} <br><br>static void subscribed_events_callback(pa_context *c, enum pa_subscription_event_type t, uint32_t index, void *userdata){<br> GtkLabel *label = (GtkLabel*) userdata<br> switch (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) {<br>
case PA_SUBSCRIPTION_EVENT_SINK_INPUT:<br> g_message("in the event callback - type = sink input and index = %d", index);<br> pa_operation_unref(pa_context_get_sink_input_info(c, index, context_get_sink_input_info_callback, userdata));<br>
// from the userdata is fine!<br> if (userdata == NULL) {<br> printf("userdata is null in the events callback");<br> }<br> else{<br> // this works fine<br> update_GUI((GtkLabel*)userdata);<br>
}<br> break;<br> }<br>}<br><br><br><br><br>