mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	module-alsa-card: use pa_module_hook_connect
Refactoring, no functional change. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
		
							parent
							
								
									a5ea142487
								
							
						
					
					
						commit
						6eae0d4bf4
					
				
					 1 changed files with 4 additions and 22 deletions
				
			
		| 
						 | 
					@ -122,12 +122,6 @@ struct userdata {
 | 
				
			||||||
    bool use_ucm;
 | 
					    bool use_ucm;
 | 
				
			||||||
    pa_alsa_ucm_config ucm;
 | 
					    pa_alsa_ucm_config ucm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* hooks for modifier action */
 | 
					 | 
				
			||||||
    pa_hook_slot
 | 
					 | 
				
			||||||
        *sink_input_put_hook_slot,
 | 
					 | 
				
			||||||
        *source_output_put_hook_slot,
 | 
					 | 
				
			||||||
        *sink_input_unlink_hook_slot,
 | 
					 | 
				
			||||||
        *source_output_unlink_hook_slot;
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct profile_data {
 | 
					struct profile_data {
 | 
				
			||||||
| 
						 | 
					@ -677,16 +671,16 @@ int pa__init(pa_module *m) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* hook start of sink input/source output to enable modifiers */
 | 
					        /* hook start of sink input/source output to enable modifiers */
 | 
				
			||||||
        /* A little bit later than module-role-cork */
 | 
					        /* A little bit later than module-role-cork */
 | 
				
			||||||
        u->sink_input_put_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], PA_HOOK_LATE+10,
 | 
					        pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], PA_HOOK_LATE+10,
 | 
				
			||||||
                (pa_hook_cb_t) sink_input_put_hook_callback, u);
 | 
					                (pa_hook_cb_t) sink_input_put_hook_callback, u);
 | 
				
			||||||
        u->source_output_put_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], PA_HOOK_LATE+10,
 | 
					        pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], PA_HOOK_LATE+10,
 | 
				
			||||||
                (pa_hook_cb_t) source_output_put_hook_callback, u);
 | 
					                (pa_hook_cb_t) source_output_put_hook_callback, u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* hook end of sink input/source output to disable modifiers */
 | 
					        /* hook end of sink input/source output to disable modifiers */
 | 
				
			||||||
        /* A little bit later than module-role-cork */
 | 
					        /* A little bit later than module-role-cork */
 | 
				
			||||||
        u->sink_input_unlink_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE+10,
 | 
					        pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE+10,
 | 
				
			||||||
                (pa_hook_cb_t) sink_input_unlink_hook_callback, u);
 | 
					                (pa_hook_cb_t) sink_input_unlink_hook_callback, u);
 | 
				
			||||||
        u->source_output_unlink_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], PA_HOOK_LATE+10,
 | 
					        pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], PA_HOOK_LATE+10,
 | 
				
			||||||
                (pa_hook_cb_t) source_output_unlink_hook_callback, u);
 | 
					                (pa_hook_cb_t) source_output_unlink_hook_callback, u);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
| 
						 | 
					@ -820,18 +814,6 @@ void pa__done(pa_module*m) {
 | 
				
			||||||
    if (!(u = m->userdata))
 | 
					    if (!(u = m->userdata))
 | 
				
			||||||
        goto finish;
 | 
					        goto finish;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->sink_input_put_hook_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->sink_input_put_hook_slot);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (u->sink_input_unlink_hook_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->sink_input_unlink_hook_slot);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (u->source_output_put_hook_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->source_output_put_hook_slot);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (u->source_output_unlink_hook_slot)
 | 
					 | 
				
			||||||
        pa_hook_slot_free(u->source_output_unlink_hook_slot);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (u->mixer_fdl)
 | 
					    if (u->mixer_fdl)
 | 
				
			||||||
        pa_alsa_fdlist_free(u->mixer_fdl);
 | 
					        pa_alsa_fdlist_free(u->mixer_fdl);
 | 
				
			||||||
    if (u->mixer_handle)
 | 
					    if (u->mixer_handle)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue