static int _xmltv_parse_tv (epggrab_module_t *mod, htsmsg_t *body, epggrab_stats_t *stats) { int save = 0; htsmsg_t *tags; htsmsg_field_t *f; if((tags = htsmsg_get_map(body, "tags")) == NULL) return 0; HTSMSG_FOREACH(f, tags) { if(!strcmp(f->hmf_name, "channel")) { save |= _xmltv_parse_channel(mod, htsmsg_get_map_by_field(f), stats); } else if(!strcmp(f->hmf_name, "programme")) { save |= _xmltv_parse_programme(mod, htsmsg_get_map_by_field(f), stats); } } return save; }
static int _xmltv_parse_tv (epggrab_module_t *mod, htsmsg_t *body, epggrab_stats_t *stats) { int gsave = 0, save; htsmsg_t *tags; htsmsg_field_t *f; if((tags = htsmsg_get_map(body, "tags")) == NULL) return 0; HTSMSG_FOREACH(f, tags) { save = 0; if(!strcmp(f->hmf_name, "channel")) { pthread_mutex_lock(&global_lock); save = _xmltv_parse_channel(mod, htsmsg_get_map_by_field(f), stats); pthread_mutex_unlock(&global_lock); } else if(!strcmp(f->hmf_name, "programme")) { pthread_mutex_lock(&global_lock); save = _xmltv_parse_programme(mod, htsmsg_get_map_by_field(f), stats); if (save) epg_updated(); pthread_mutex_unlock(&global_lock); } gsave |= save; }