static void tvhdhomerun_device_class_override_notify( void * obj, const char *lang ) { tvhdhomerun_device_t *hd = obj; tvhdhomerun_frontend_t *hfe; dvb_fe_type_t type = dvb_str2type(hd->hd_override_type); struct hdhomerun_discover_device_t discover_info; unsigned int tuner; htsmsg_t *conf; conf = hts_settings_load("input/tvhdhomerun/adapters/%s", hd->hd_info.uuid); if (conf) conf = htsmsg_get_map(conf, "frontends"); lock_assert(&global_lock); while ((hfe = TAILQ_FIRST(&hd->hd_frontends)) != NULL) { if (hfe->hf_type == type) break; discover_info.device_id = hdhomerun_device_get_device_id(hfe->hf_hdhomerun_tuner); discover_info.ip_addr = hdhomerun_device_get_device_ip(hfe->hf_hdhomerun_tuner); tuner = hfe->hf_tunerNumber; tvhdhomerun_frontend_delete(hfe); tvhdhomerun_frontend_create(hd, &discover_info, conf, type, tuner); } }
void tvhdhomerun_device_destroy( tvhdhomerun_device_t *hd ) { tvhdhomerun_frontend_t *lfe; lock_assert(&global_lock); mtimer_disarm(&hd->hd_destroy_timer); idnode_save_check(&hd->th_id, 0); tvhinfo(LS_TVHDHOMERUN, "Releasing locks for devices"); while ((lfe = TAILQ_FIRST(&hd->hd_frontends)) != NULL) { tvhdhomerun_frontend_delete(lfe); } #define FREEM(x) free(hd->hd_info.x) FREEM(friendlyname); FREEM(uuid); FREEM(deviceModel); #undef FREEM tvh_hardware_delete((tvh_hardware_t*)hd); #define FREEM(x) free(hd->x) FREEM(hd_override_type); #undef FREEM free(hd); }
void tvhdhomerun_device_destroy( tvhdhomerun_device_t *hd ) { tvhdhomerun_frontend_t *lfe; lock_assert(&global_lock); gtimer_disarm(&hd->hd_destroy_timer); tvhlog(LOG_INFO, "tvhdhomerun", "Releasing locks for devices"); while ((lfe = TAILQ_FIRST(&hd->hd_frontends)) != NULL) { tvhdhomerun_frontend_delete(lfe); } #define FREEM(x) free(hd->hd_info.x) FREEM(ip_address); FREEM(friendlyname); FREEM(uuid); FREEM(deviceModel); #undef FREEM tvh_hardware_delete((tvh_hardware_t*)hd); #define FREEM(x) free(hd->x) FREEM(hd_override_type); #undef FREEM free(hd); }