mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	allow-passthrough: Use pa_module_hook_connect()
Signed-off-by: Arun Raghavan <git@arunraghavan.net>
This commit is contained in:
		
							parent
							
								
									14804ba1ca
								
							
						
					
					
						commit
						0985a717f3
					
				
					 1 changed files with 4 additions and 19 deletions
				
			
		| 
						 | 
					@ -51,12 +51,6 @@ struct userdata {
 | 
				
			||||||
     * its streams. */
 | 
					     * its streams. */
 | 
				
			||||||
    pa_hashmap *null_sinks;
 | 
					    pa_hashmap *null_sinks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_hook_slot
 | 
					 | 
				
			||||||
        *sink_input_new_slot,
 | 
					 | 
				
			||||||
        *sink_input_unlink_slot,
 | 
					 | 
				
			||||||
        *sink_input_move_start_slot,
 | 
					 | 
				
			||||||
        *sink_input_move_finish_slot;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    bool moving;
 | 
					    bool moving;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -281,10 +275,10 @@ int pa__init(pa_module*m) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    u->null_sinks = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
 | 
					    u->null_sinks = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    u->sink_input_new_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_NEW], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_new_cb, u);
 | 
					    pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_NEW], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_new_cb, u);
 | 
				
			||||||
    u->sink_input_unlink_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_unlink_cb, u);
 | 
					    pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_unlink_cb, u);
 | 
				
			||||||
    u->sink_input_move_start_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_START], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_start_cb, u);
 | 
					    pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_START], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_start_cb, u);
 | 
				
			||||||
    u->sink_input_move_finish_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_FINISH], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_finish_cb, u);
 | 
					    pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_FINISH], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_finish_cb, u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    u->moving = false;
 | 
					    u->moving = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -308,15 +302,6 @@ void pa__done(pa_module*m) {
 | 
				
			||||||
    if (!(u = m->userdata))
 | 
					    if (!(u = m->userdata))
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->sink_input_new_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->sink_input_new_slot);
 | 
					 | 
				
			||||||
    if (u->sink_input_unlink_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->sink_input_unlink_slot);
 | 
					 | 
				
			||||||
    if (u->sink_input_move_start_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->sink_input_move_start_slot);
 | 
					 | 
				
			||||||
    if (u->sink_input_move_finish_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->sink_input_move_finish_slot);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (m->core->state != PA_CORE_SHUTDOWN)
 | 
					    if (m->core->state != PA_CORE_SHUTDOWN)
 | 
				
			||||||
        unload_all_null_sink_modules(u, m->core);
 | 
					        unload_all_null_sink_modules(u, m->core);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue