Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
iptv auto: add parsing of tvh-epg #EXTINF tag, see commit for all str…
…ings, fixes #3225
  • Loading branch information
perexg committed Feb 3, 2016
1 parent c665cff commit 7ec7cfa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/input/mpegts.h
Expand Up @@ -384,7 +384,7 @@ enum mpegts_mux_epg_flag
MM_EPG_ONLY_BULSATCOM_39E,
MM_EPG_ONLY_PSIP,
};
#define MM_EPG_LAST MM_EPG_ONLY_OPENTV_SKY_AUSAT
#define MM_EPG_LAST MM_EPG_ONLY_PSIP

enum mpegts_mux_ac3_flag
{
Expand Down
38 changes: 37 additions & 1 deletion src/input/mpegts/iptv/iptv_auto.c
Expand Up @@ -33,6 +33,35 @@ typedef struct auto_private {
gtimer_t in_auto_timer;
} auto_private_t;

/*
*
*/
static int _epgcfg_from_str(const char *str)
{
static struct strtab cfgs[] = {
{ "0", MM_EPG_DISABLE },
{ "none", MM_EPG_DISABLE },
{ "disable", MM_EPG_DISABLE },
{ "off", MM_EPG_DISABLE },
{ "1", MM_EPG_ENABLE },
{ "all", MM_EPG_ENABLE },
{ "enable", MM_EPG_ENABLE },
{ "on", MM_EPG_ENABLE },
{ "force", MM_EPG_FORCE },
{ "eit", MM_EPG_ONLY_EIT },
{ "uk_freesat", MM_EPG_ONLY_UK_FREESAT },
{ "uk_freeview", MM_EPG_ONLY_UK_FREEVIEW },
{ "viasat_baltic", MM_EPG_ONLY_VIASAT_BALTIC },
{ "opentv_sky_uk", MM_EPG_ONLY_OPENTV_SKY_UK },
{ "opentv_sky_italia", MM_EPG_ONLY_OPENTV_SKY_ITALIA },
{ "opentv_sky_ausat", MM_EPG_ONLY_OPENTV_SKY_AUSAT },
{ "bulsatcom_39e", MM_EPG_ONLY_BULSATCOM_39E },
{ "psip", MM_EPG_ONLY_PSIP },
{ NULL }
};
return str ? str2val(str, cfgs) : -1;
}

/*
*
*/
Expand All @@ -48,7 +77,7 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in,
mpegts_mux_t *mm;
iptv_mux_t *im;
url_t u;
int change;
int change, epgcfg;
http_arg_list_t args;
http_arg_t *ra1, *ra2, *ra2_next;
htsbuf_queue_t q;
Expand Down Expand Up @@ -90,6 +119,7 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in,
logo = htsmsg_get_str(item, "logo");

epgid = htsmsg_get_str(item, "tvg-id");
epgcfg = _epgcfg_from_str(htsmsg_get_str(item, "tvh-epg"));
tags = htsmsg_get_str(item, "tvh-tags");
if (tags) {
tags = n = strdupa(tags);
Expand Down Expand Up @@ -208,6 +238,10 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in,
im->mm_iptv_tags = strdup(tags);
change = 1;
}
if (epgcfg >= 0 && im->mm_epg != epgcfg) {
im->mm_epg = epgcfg;
change = 1;
}
if (change)
idnode_notify_changed(&im->mm_id);
(*total)++;
Expand Down Expand Up @@ -237,6 +271,8 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in,
htsmsg_add_s32(conf, "scan_result", MM_SCAN_OK);
if (custom[0])
htsmsg_add_str(conf, "iptv_hdr", custom);
if (epgcfg >= 0)
htsmsg_add_s32(conf, "epg", epgcfg);
im = iptv_mux_create0(in, NULL, conf);
htsmsg_destroy(conf);

Expand Down

0 comments on commit 7ec7cfa

Please sign in to comment.