I am going to post a few of my diff files, so anyone call pull tvheadend 4.2.x from github and apply some patches.
src/epggrab/module/eit.c is the file that needs a few tweaks to improve the EPG data. Currently, all the details are in a single string. It only needs a delimiter to separate the episode, air date, and series name. Genre is already figured out, so it can simply be removed from the description.
The same file needs a little work around line 650 to include multiple dishes.
If anyone is willing to contribute, go ahead and reply to this thread so we can improve the existing packages.
src/config.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/config.c
+++ b/src/config.c
@@ -611,6 +611,8 @@
htsmsg_add_u32(m, "opentv-skyuk", 1);
htsmsg_add_u32(m, "opentv-skyit", 1);
htsmsg_add_u32(m, "opentv-ausat", 1);
+ htsmsg_add_u32(m, "na_dish", 1);
+ htsmsg_add_u32(m, "na_bell", 1);
}
hts_settings_save(c, "epggrab/config");
src/epggrab/module/eit.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/epggrab/module/eit.c
+++ b/src/epggrab/module/eit.c
@@ -313,6 +313,37 @@
static int _eit_desc_content
( epggrab_module_t *mod, const uint8_t *ptr, int len, eit_event_t *ev )
{
+ // Disnetwork / Bell Expressvu
+ const unsigned char *data = ptr;
+ if ( !ev->genre && data[0] >= 0xF0 && data[0] <= 0xF8 )
+ {
+ ev->genre = calloc(1, sizeof(epg_genre_list_t));
+ if ( data[0] == 0xF0 ) epg_genre_list_add_by_eit(ev->genre, 0xA0); // Paid programming
+ if ( data[0] == 0xF1 ) epg_genre_list_add_by_eit(ev->genre, 0x10); // Movies
+ if ( data[0] == 0xF2 ) epg_genre_list_add_by_eit(ev->genre, 0x40); // Sports
+ if ( data[0] == 0xF3 ) epg_genre_list_add_by_eit(ev->genre, 0x20); // News
+ if ( data[0] == 0xF4 ) epg_genre_list_add_by_eit(ev->genre, 0x50); // Children
+ if ( data[0] == 0xF5 ) epg_genre_list_add_by_eit(ev->genre, 0x90); // Education
+ if ( data[0] == 0xF6 ) epg_genre_list_add_by_eit(ev->genre, 0x30); // Series
+ if ( data[0] == 0xF7 ) epg_genre_list_add_by_eit(ev->genre, 0x60); // Music
+ if ( data[0] == 0xF8 ) epg_genre_list_add_by_eit(ev->genre, 0x70); // Religous
+
+ // This allows us to split a string by a delimter
+ // https://stackoverflow.com/questions/14265581/parse-split-a-string-in-c-using-string-delimiter-standard-c
+ //
+ // Dishnetwork descriptors
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/eitfixup.cpp
+ //
+ // Dishdescriptors.h
+ // https://code.mythtv.org/doxygen/eitfixup_8cpp_source.html#l00431
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/mpeg/dishdescriptors.cpp
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/mpeg/dishdescriptors.h
+
+
+
+ return 0;
+ }
+
while (len > 1) {
if (*ptr == 0xb1)
ev->bw = 1;
@@ -490,11 +521,15 @@
r = _eit_desc_component(mod, ptr, dlen, &ev);
break;
case DVB_DESC_PARENTAL_RAT:
+ case DVB_DESC_DISHNET_MPAA:
r = _eit_desc_parental(mod, ptr, dlen, &ev);
break;
case DVB_DESC_CRID:
r = _eit_desc_crid(mod, ptr, dlen, &ev, svc);
break;
+ //case DVB_DESC_DISHNET_PROGID:
+ // r = _eit_dishnet_desc_crid(mod, ptr, dlen, &ev, svc);
+ // break;
default:
r = 0;
_eit_dtag_dump(mod, dtag, dlen, ptr);
@@ -649,7 +684,7 @@
}
/* Validate */
- if(tableid < 0x4e || tableid > 0x6f || len < 11) {
+ if((tableid < 0x4e || tableid > 0x6f || len < 11) && (tableid < 0x81 || tableid > 0xa4 || len < 11)) {
if (ths)
atomic_add(&ths->ths_total_err, 1);
return -1;
@@ -887,6 +922,8 @@
EIT_OPS(ops_nz_freeview, 0, EIT_CONV_HUFFMAN, EIT_SPEC_NZ_FREEVIEW);
EIT_OPS(ops_baltic, 0x39, 0, 0);
EIT_OPS(ops_bulsat, 0x12b, 0, 0);
+ EIT_OPS(ops_na_dish, 0x300, EIT_CONV_HUFFMAN, 0);
+ EIT_OPS(ops_na_bell, 0x441, EIT_CONV_HUFFMAN, 0);
EIT_CREATE("eit", "EIT: DVB Grabber", 1, &ops);
EIT_CREATE("uk_freesat", "UK: Freesat", 5, &ops_uk_freesat);
@@ -894,6 +931,8 @@
EIT_CREATE("nz_freeview", "New Zealand: Freeview", 5, &ops_nz_freeview);
EIT_CREATE("viasat_baltic", "VIASAT: Baltic", 5, &ops_baltic);
EIT_CREATE("Bulsatcom_39E", "Bulsatcom: Bula 39E", 5, &ops_bulsat);
+ EIT_CREATE("na_dish", "NA Dish", 5, &ops_na_dish);
+ EIT_CREATE("na_bell", "NA Bell", 5, &ops_na_bell);
}
void eit_done ( void )
src/epggrab/otamux.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/epggrab/otamux.c
+++ b/src/epggrab/otamux.c
@@ -496,6 +496,8 @@
[MM_EPG_ONLY_OPENTV_SKY_UK] = "opentv-skyuk",
[MM_EPG_ONLY_OPENTV_SKY_ITALIA] = "opentv-skyit",
[MM_EPG_ONLY_OPENTV_SKY_AUSAT] = "opentv-ausat",
+ [MM_EPG_ONLY_DISHNET_DISH] = "na_dish",
+ [MM_EPG_ONLY_DISHNET_BELL] = "na_bell",
};
lock_assert(&global_lock);
src/epggrab/support/freesat_huffman.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/epggrab/support/freesat_huffman.c
+++ b/src/epggrab/support/freesat_huffman.c
@@ -5777,7 +5777,7 @@
unsigned short kk;
unsigned int b;
- if (src[0] != 0x1f) return -1;
+ if (src[0] != 0x1f && src[0] != 0xff) return -1;
p = 0;
if (src[1] == 1 || src[1] == 2) {
src/input/mpegts.h
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts.h
+++ b/src/input/mpegts.h
@@ -400,6 +400,8 @@
MM_EPG_ONLY_OPENTV_SKY_AUSAT,
MM_EPG_ONLY_BULSATCOM_39E,
MM_EPG_ONLY_PSIP,
+ MM_EPG_ONLY_DISHNET_DISH,
+ MM_EPG_ONLY_DISHNET_BELL,
};
#define MM_EPG_LAST MM_EPG_ONLY_PSIP
src/input/mpegts/dvb.h
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/dvb.h
+++ b/src/input/mpegts/dvb.h
@@ -188,6 +188,9 @@
#define ATSC_DESC_GENRE 0xAB
#define ATSC_DESC_PRIVATE_INFO 0xAD
+#define DVB_DESC_DISHNET_MPAA 0x89 // Stars and MPAA ratings
+#define DVB_DESC_DISHNET_PROGID 0x96 // Series ID, Program ID, and Original air date
+
/* Service type lookup */
int dvb_servicetype_lookup ( int t );
src/input/mpegts/dvb_support.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/dvb_support.c
+++ b/src/input/mpegts/dvb_support.c
@@ -266,7 +266,7 @@
/* Check custom conversion */
while (conv && conv->func) {
- if (conv->type == src[0])
+ if ((conv->type == src[0]) || (conv->type == 0xff ))
return conv->func(dst, &dstlen, src, srclen);
conv++;
}
@@ -382,7 +382,7 @@
{
int l = buf[0];
- if(l + 1 > buflen)
+ if(l + 1 > buflen && conv->type != 0xff)
return -1;
if(dvb_get_string(dst, dstlen, buf + 1, l, dvb_charset, conv))
src/input/mpegts/linuxdvb/linuxdvb_switch.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c
+++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c
@@ -174,9 +174,47 @@
linuxdvb_satconf_ele_t *sc, int vol, int pol, int band, int freq )
{
int i, com, r1 = 0, r2 = 0, slp;
+ unsigned char cmd = 0;
int fd = linuxdvb_satconf_fe_fd(lsp);
linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld;
+ if (!strcmp(ld->ld_type ?: "", "Legacy SW21")) {
+ if ( ls->ls_uncommitted % 2 == 0 )
+ cmd = 0x34;
+ else
+ cmd = 0x65;
+
+ if ( pol == 1 )
+ cmd |= 0x80;
+
+ if (ioctl(fd, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd)){
+ tvherror(LS_DISEQC, "failed to issue legacy switch command (e=%s)", strerror(errno));
+ return -1;
+ }
+
+ /* sleep for 240 milliseconds */
+ usleep(240 * 1000);
+
+ return 0;
+ }
+
+ if (!strcmp(ld->ld_type ?: "", "Legacy SW42")) {
+ if ( ls->ls_uncommitted % 2 == 0 )
+ cmd = 0x46;
+ else
+ cmd = 0x17;
+
+ if (ioctl(fd, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd)){
+ tvherror(LS_DISEQC, "failed to issue legacy switch command (e=%s)", strerror(errno));
+ return -1;
+ }
+
+ /* sleep for 240 milliseconds */
+ usleep(240 * 1000);
+
+ return 0;
+ }
+
if (lsp->ls_diseqc_full || lsp->ls_last_switch != sc ||
(ls->ls_committed >= 0 &&
(pol + 1 != lsp->ls_last_switch_pol ||
@@ -261,6 +299,8 @@
htsmsg_t *m = htsmsg_create_list();
htsmsg_add_msg(m, NULL, htsmsg_create_key_val("", tvh_gettext_lang(lang, N_("None"))));
htsmsg_add_msg(m, NULL, htsmsg_create_key_val("Generic", tvh_gettext_lang(lang, N_("Generic"))));
+ htsmsg_add_msg(m, NULL, htsmsg_create_key_val("Legacy SW21", tvh_gettext_lang(lang, N_("Legacy SW21"))));
+ htsmsg_add_msg(m, NULL, htsmsg_create_key_val("Legacy SW42", tvh_gettext_lang(lang, N_("Legacy SW42"))));
return m;
}
@@ -269,8 +309,8 @@
( const char *name, htsmsg_t *conf, linuxdvb_satconf_ele_t *ls, int c, int u )
{
linuxdvb_switch_t *ld = NULL;
- if (!strcmp(name ?: "", "Generic")) {
- ld = (linuxdvb_switch_t*)linuxdvb_diseqc_create(linuxdvb_switch, NULL, conf, "Generic", ls);
+ if (!strcmp(name ?: "", "Generic") || !strcmp(name ?: "", "Legacy SW21") || !strcmp(name ?: "", "Legacy SW42")) {
+ ld = (linuxdvb_switch_t*)linuxdvb_diseqc_create(linuxdvb_switch, NULL, conf, name, ls);
if (ld) {
ld->ld_tune = linuxdvb_switch_tune;
if (!conf) {
src/input/mpegts/mpegts_mux.c
Code:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/mpegts_mux.c
+++ b/src/input/mpegts/mpegts_mux.c
@@ -490,6 +490,8 @@
{ N_("Only OpenTV Sky UK"), MM_EPG_ONLY_OPENTV_SKY_UK },
{ N_("Only OpenTV Sky Italia"), MM_EPG_ONLY_OPENTV_SKY_ITALIA },
{ N_("Only OpenTV Sky Ausat"), MM_EPG_ONLY_OPENTV_SKY_AUSAT },
+ { N_("Only Dish Network"), MM_EPG_ONLY_DISHNET_DISH },
+ { N_("Only Bell Expressvu"), MM_EPG_ONLY_DISHNET_BELL },
};
return strtab2htsmsg(tab, 1, lang);
}