Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
scanfile: add some loading stats and warning when predefined muxes ar…
…e empty
  • Loading branch information
perexg committed Feb 9, 2015
1 parent a6ac407 commit f578c96
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/input/mpegts/scanfile.c
Expand Up @@ -681,13 +681,36 @@ scanfile_load_dir
fb_closedir(dir);
}

/*
*
*/
static int
scanfile_stats(const char *what, scanfile_region_list_t *list)
{
scanfile_region_t *reg;
scanfile_network_t *sfn;
int regions = 0, networks =0;

LIST_FOREACH(reg, list, sfr_link) {
regions++;
LIST_FOREACH(sfn, &reg->sfr_networks, sfn_link)
networks++;
}
if (regions) {
tvhinfo("scanfile", "%s - loaded %i regions with %i networks", what, regions, networks);
return 1;
}
return 0;
}

/*
* Initialise the mux list
*/
void
scanfile_init ( void )
{
const char *path = config_get_muxconfpath();
int r = 0;
if (!path || !*path)
#if ENABLE_DVBSCAN
path = "data/dvb-scan";
Expand All @@ -697,6 +720,17 @@ scanfile_init ( void )
path = "/usr/share/dvb";
#endif
scanfile_load_dir(path, NULL, 0);

r += scanfile_stats("DVB-T", &scanfile_regions_DVBT);
r += scanfile_stats("DVB-S", &scanfile_regions_DVBS);
r += scanfile_stats("DVB-C", &scanfile_regions_DVBC);
r += scanfile_stats("ATSC", &scanfile_regions_ATSC);
if (!r) {
tvhwarn("scanfile", "no predefined muxes found, check path '%s%s'",
path[0] == '/' ? path : TVHEADEND_DATADIR "/",
path[0] == '/' ? "" : path);
tvhwarn("scanfile", "expected tree structure - http://git.linuxtv.org/cgit.cgi/dtv-scan-tables.git/tree/");
}
}

/*
Expand Down

0 comments on commit f578c96

Please sign in to comment.