linuxdvb: add satconf delete handler
This commit is contained in:
parent
63adaed02e
commit
6710be3c59
4 changed files with 39 additions and 1 deletions
|
@ -483,6 +483,8 @@ mpegts_input_t *mpegts_input_create0
|
|||
mpegts_input_create0(calloc(1, sizeof(mpegts_input_t)),\
|
||||
&mpegts_input_class, u, c)
|
||||
|
||||
void mpegts_input_delete ( mpegts_input_t *mi );
|
||||
|
||||
#define mpegts_input_find(u) idnode_find(u, &mpegts_input_class);
|
||||
|
||||
void mpegts_input_set_network ( mpegts_input_t *mi, mpegts_network_t *mn );
|
||||
|
|
|
@ -294,4 +294,6 @@ void linuxdvb_satconf_init ( void );
|
|||
|
||||
linuxdvb_satconf_t *linuxdvb_satconf_create0(const char *uuid, htsmsg_t *conf);
|
||||
|
||||
void linuxdvb_satconf_delete ( linuxdvb_satconf_t *ls );
|
||||
|
||||
#endif /* __TVH_LINUXDVB_PRIVATE_H__ */
|
||||
|
|
|
@ -265,6 +265,12 @@ linuxdvb_satconf_class_get_childs ( idnode_t *o )
|
|||
return is;
|
||||
}
|
||||
|
||||
static void
|
||||
linuxdvb_satconf_class_delete ( idnode_t *in )
|
||||
{
|
||||
linuxdvb_satconf_delete((linuxdvb_satconf_t*)in);
|
||||
}
|
||||
|
||||
const idclass_t linuxdvb_satconf_class =
|
||||
{
|
||||
.ic_super = &mpegts_input_class,
|
||||
|
@ -273,6 +279,7 @@ const idclass_t linuxdvb_satconf_class =
|
|||
.ic_get_title = linuxdvb_satconf_class_get_title,
|
||||
.ic_get_childs = linuxdvb_satconf_class_get_childs,
|
||||
.ic_save = linuxdvb_satconf_class_save,
|
||||
.ic_delete = linuxdvb_satconf_class_delete,
|
||||
.ic_properties = (const property_t[]) {
|
||||
{
|
||||
.type = PT_STR,
|
||||
|
@ -596,7 +603,22 @@ linuxdvb_satconf_create0
|
|||
return ls;
|
||||
}
|
||||
|
||||
void linuxdvb_satconf_init ( void )
|
||||
void
|
||||
linuxdvb_satconf_delete ( linuxdvb_satconf_t *ls )
|
||||
{
|
||||
const char *uuid = idnode_uuid_as_str(&ls->ti_id);
|
||||
hts_settings_remove("input/linuxdvb/satconfs/%s", uuid);
|
||||
if (ls->ls_lnb)
|
||||
linuxdvb_lnb_destroy(ls->ls_lnb);
|
||||
if (ls->ls_switch)
|
||||
linuxdvb_switch_destroy(ls->ls_switch);
|
||||
if (ls->ls_rotor)
|
||||
linuxdvb_rotor_destroy(ls->ls_rotor);
|
||||
mpegts_input_delete((mpegts_input_t*)ls);
|
||||
}
|
||||
|
||||
void
|
||||
linuxdvb_satconf_init ( void )
|
||||
{
|
||||
htsmsg_t *s, *e;
|
||||
htsmsg_field_t *f;
|
||||
|
|
|
@ -517,6 +517,18 @@ mpegts_input_create0
|
|||
return mi;
|
||||
}
|
||||
|
||||
void
|
||||
mpegts_input_delete ( mpegts_input_t *mi )
|
||||
{
|
||||
idnode_unlink(&mi->ti_id);
|
||||
pthread_mutex_destroy(&mi->mi_delivery_mutex);
|
||||
pthread_cond_destroy(&mi->mi_table_feed_cond);
|
||||
tvh_pipe_close(&mi->mi_thread_pipe);
|
||||
LIST_REMOVE(mi, ti_link);
|
||||
LIST_REMOVE(mi, mi_global_link);
|
||||
free(mi);
|
||||
}
|
||||
|
||||
void
|
||||
mpegts_input_save ( mpegts_input_t *mi, htsmsg_t *m )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue