pa_dbus_connection *dbus_conn;
pa_hal_interface *hal_interface;
bool is_poweroff;
- pa_hook_slot *sink_input_put_slot;
+ pa_hook_slot *sink_input_new_slot;
};
static void mute_all_streams(struct userdata *u)
hal_route_option route_option;
PA_IDXSET_FOREACH(si, u->module->core->sink_inputs, idx) {
- pa_log_info("POWEROFF : mute sink-input(%d)", idx);
+ pa_log_info("POWEROFF : mute sink-input(%d)", idx);
/* FIXME : Any exceptions for mute? */
pa_sink_input_set_mute(si, true, false);
}
}
-static pa_hook_result_t sink_input_put_cb(pa_core *core, pa_sink_input *i, struct userdata *u) {
+static pa_hook_result_t sink_input_new_cb(pa_core *core, pa_sink_input_new_data *new_data, struct userdata *u) {
const char *vol_gain_type = NULL;
pa_core_assert_ref(core);
- pa_sink_input_assert_ref(i);
if (!u->is_poweroff)
return PA_HOOK_OK;
- vol_gain_type = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_TIZEN_VOLUME_GAIN_TYPE);
+ vol_gain_type = pa_proplist_gets(new_data->proplist, PA_PROP_MEDIA_TIZEN_VOLUME_GAIN_TYPE);
if (pa_safe_streq(vol_gain_type, BOOT_GAIN_TYPE)) {
- pa_log_info(" sink-input(%d) is [%s], ignore mute", i->index, BOOT_GAIN_TYPE);
+ pa_log_info(" ignore mute for gain [%s]", BOOT_GAIN_TYPE);
} else {
- pa_log_info(" Mute sink-input(%d) due to POWEROFF", i->index);
- pa_sink_input_set_mute(i, true, false);
+ pa_log_info(" Mute sink-input due to POWEROFF");
+ pa_sink_input_new_data_set_muted(new_data, true);
}
return PA_HOOK_OK;
}
u->hal_interface = pa_hal_interface_get(u->module->core);
- u->sink_input_put_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_put_cb, u);
+ 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);
return 0;
}
if (!(u = m->userdata))
return;
- if (u->sink_input_put_slot)
- pa_hook_slot_free(u->sink_input_put_slot);
+ if (u->sink_input_new_slot)
+ pa_hook_slot_free(u->sink_input_new_slot);
if (u->hal_interface)
pa_hal_interface_unref(u->hal_interface);