On Thu, 2011-06-09 at 18:02 +0300, Tanu Kaskinen wrote: > On Thu, 2011-06-09 at 16:37 +0800, Lin, Mengdong wrote: > > How is the function "pa_sink_input_process_msg()" is called? Is it called from a sink's IO thread? > > Yes. In case a more detailed answer is needed, pa_sink_input_process_msg() is the default message handler for pa_sink_input. Being a message handler for pa_sink_input means that when someone sends a message using pa_asyncmsgq_send() or pa_asyncmsgq_post() to a pa_sink_input object, the message handler will get called in the IO thread. Sink input implementers can override the default message handler with their own implementation. If they do that, then they usually call pa_sink_input_process_msg() explicitly for those messages that they don't want to handle specially (or in addition to handling the messages specially, they also want the default handler to do what it always does). You can find many examples this in the code if you grep for "pa_sink_input_process_msg". -- Tanu