Project

General

Profile

Bug #1077 ยป t.patch

Updated UK Freeview (HD) support. - Adam Sutton, 2012-08-04 10:43

View differences:

src/epggrab/module/eit.c
145 145
 * Get string
146 146
 */
147 147
static int _eit_get_string_with_len
148
  ( epggrab_module_t *mod,
148
  ( epggrab_module_t *m,
149 149
    char *dst, size_t dstlen, 
150 150
		const uint8_t *src, size_t srclen, char *charset )
151 151
{
152 152
  dvb_string_conv_t *cptr = NULL;
153
  if (!strcmp("freesat", mod->id)) {
154
    cptr = _eit_freesat_conv;
155
  }
156 153

  
154
  /* Enable huffman decode (for freeview and/or freesat) */
155
  m = epggrab_module_find_by_id("uk_freeview");
156
  if (m && m->enabled) cptr = _eit_freesat_conv;
157
  else
158
    m = epggrab_module_find_by_id("uk_freeview");
159
    if (m && m->enabled) cptr = _eit_freesat_conv;
160

  
161
  /* Convert */
157 162
  return dvb_get_string_with_len(dst, dstlen, src, srclen, charset, cptr);
158 163
}
159 164

  
......
630 635
  ( epggrab_module_ota_t *m, th_dvb_mux_instance_t *tdmi )
631 636
{
632 637
  epggrab_ota_mux_t *ota;
638

  
639
  /* Disabled */
633 640
  if (!m->enabled) return;
641

  
642
  /* Freeview (switch to EIT, ignore if explicitly enabled) */
643
  if (!strcmp(m->id, "uk_freeview")) {
644
    m = (epggrab_module_ota_t*)epggrab_module_find_by_id("eit");
645
    if (m->enabled) return;
646
  }
647

  
648
  /* Register */
634 649
  if (!(ota = epggrab_ota_create(m, tdmi))) return;
635 650
  if (!ota->status) {
636 651
    ota->status  = calloc(1, sizeof(eit_status_list_t));
637 652
    ota->destroy = _eit_ota_destroy;
638 653
  }
639
  if (!strcmp("freesat", m->id)) {
654

  
655
  /* Add PIDs (freesat uses non-standard) */
656
  if (!strcmp("uk_freesat", m->id)) {
640 657
#ifdef IGNORE_TOO_SLOW
641 658
    tdt_add(tdmi, NULL, _eit_callback, m, m->id, TDT_CRC, 3841, NULL);
642 659
#endif
643 660
    tdt_add(tdmi, NULL, _eit_callback, m, m->id, TDT_CRC, 3003, NULL);
644
  } else
661
  } else {
645 662
    tdt_add(tdmi, NULL, _eit_callback, m, m->id, TDT_CRC, 0x12, NULL);
646
  tvhlog(LOG_INFO, m->id, "install table handlers");
663
  }
664
  tvhlog(LOG_DEBUG, m->id, "install table handlers");
647 665
}
648 666

  
649 667
static int _eit_enable ( void *m, uint8_t e )
......
655 673

  
656 674
  /* Register interest */
657 675
  if (e) {
658
    if (!strcmp(mod->id, "freesat"))
676

  
677
    /* Freesat (register fixed MUX) */
678
    if (!strcmp(mod->id, "uk_freesat")) {
659 679
#ifdef IGNORE_TOO_SLOW
660 680
      epggrab_ota_create_and_register_by_id((epggrab_module_ota_t*)mod,
661 681
                                            0, 2050,
......
664 684
      epggrab_ota_create_and_register_by_id((epggrab_module_ota_t*)mod,
665 685
                                            0, 2315,
666 686
                                            600, 3600, "Freesat");
687
    }
667 688
  /* Remove all links */
668 689
  } else {
669 690
    epggrab_ota_destroy_by_module((epggrab_module_ota_t*)mod);
......
676 697
{
677 698
  epggrab_module_ota_create(NULL, "eit", "EIT: DVB Grabber", 1,
678 699
                            _eit_start, _eit_enable, NULL);
679
  epggrab_module_ota_create(NULL, "freesat", "Freesat", 5,
700
  epggrab_module_ota_create(NULL, "uk_freesat", "UK: Freesat", 5,
701
                            _eit_start, _eit_enable, NULL);
702
  epggrab_module_ota_create(NULL, "uk_freeview", "UK: Freeview", 5,
680 703
                            _eit_start, _eit_enable, NULL);
681 704
}
682 705

  
src/epggrab/otamux.c
39 39
void epggrab_mux_start ( th_dvb_mux_instance_t *tdmi )
40 40
{
41 41
  epggrab_module_t *m;
42
  epggrab_module_ota_t *om;
42 43
  LIST_FOREACH(m, &epggrab_modules, link) {
43 44
    if (m->type == EPGGRAB_OTA) {
44
      ((epggrab_module_ota_t*)m)->start((epggrab_module_ota_t*)m, tdmi);
45
      om = (epggrab_module_ota_t*)m;
46
      if (om->start) om->start(om, tdmi);
45 47
    }
46 48
  }
47 49
}
    (1-1/1)