Esempio n. 1
0
/*
 * Process mux entry
 */
static void
scanfile_load_one ( scanfile_network_t *net, const char *line )
{
  int r = 1;
  dvb_mux_conf_t *mux = calloc(1, sizeof(dvb_mux_conf_t));
  
  switch (line[0]) {
    case 'A':
      r = scanfile_load_atsc(mux, line+1);
      break;
    case 'T':
      r = scanfile_load_dvbt(mux, line+1);
      break;
    case 'S':
      r = scanfile_load_dvbs(mux, line+1);
      break;
    case 'C':
      r = scanfile_load_dvbc(mux, line+1);
      break;
  }

  tvhtrace("scanfile", "[%s] %s", line, r ? "FAIL" : "OK");
  if (r) {
    free(mux);
  } else {
    LIST_INSERT_HEAD(&net->sfn_muxes, mux, dmc_link);
  }
}
Esempio n. 2
0
/*
 * Process mux entry
 */
static int
scanfile_load_one
  ( scanfile_network_t **net, const char *type, const char *name, const char *line )
{
  int r = 1;
  dvb_mux_conf_t *mux = malloc(sizeof(dvb_mux_conf_t));
  
  switch (line[0]) {
    case 'A':
      r = scanfile_load_atsc(mux, line+1);
      break;
    case 'T':
      r = scanfile_load_dvbt(mux, line+1);
      break;
    case 'S':
      r = scanfile_load_dvbs(mux, line+1);
      break;
    case 'C':
      r = scanfile_load_dvbc(mux, line+1);
      break;
  }

  tvhtrace("scanfile", "[%s] %s", line, r ? "FAIL" : "OK");
  if (r) {
    free(mux);
  } else {
    if (*net == NULL && scanfile_create_network(net, type, name, mux->dmc_fe_delsys)) {
      free(mux);
      return -1;
    }
    LIST_INSERT_HEAD(&(*net)->sfn_muxes, mux, dmc_link);
  }
  return 1;
}