From f2f9bcf3a73b71beae23de7c13d0b46a27479852 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 16 Oct 2015 14:01:44 +0200 Subject: [PATCH] IPTV: Add 'Scan After Create' and 'Service ID' fields to network --- src/input/mpegts/iptv/iptv.c | 19 ++++++++++++++++++- src/input/mpegts/iptv/iptv_auto.c | 15 +++++++++++++++ src/input/mpegts/iptv/iptv_private.h | 3 +++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/input/mpegts/iptv/iptv.c b/src/input/mpegts/iptv/iptv.c index 12d421fad..d3b166c78 100644 --- a/src/input/mpegts/iptv/iptv.c +++ b/src/input/mpegts/iptv/iptv.c @@ -571,6 +571,22 @@ const idclass_t iptv_network_class = { .ic_caption = N_("IPTV Network"), .ic_delete = iptv_network_class_delete, .ic_properties = (const property_t[]){ + { + .type = PT_BOOL, + .id = "scan_create", + .name = N_("Scan After Create"), + .off = offsetof(iptv_network_t, in_scan_create), + .def.i = 1, + .opts = PO_ADVANCED + }, + { + .type = PT_U16, + .id = "service_sid", + .name = N_("Service ID"), + .off = offsetof(iptv_network_t, in_service_id), + .def.i = 0, + .opts = PO_ADVANCED + }, { .type = PT_INT, .id = "priority", @@ -762,7 +778,8 @@ iptv_network_create0 htsmsg_t *c; /* Init Network */ - in->in_priority = 1; + in->in_scan_create = 1; + in->in_priority = 1; in->in_streaming_priority = 1; if (idc == &iptv_auto_network_class) in->in_remove_args = strdup("ticket"); diff --git a/src/input/mpegts/iptv/iptv_auto.c b/src/input/mpegts/iptv/iptv_auto.c index 694587f9c..0d222556e 100644 --- a/src/input/mpegts/iptv/iptv_auto.c +++ b/src/input/mpegts/iptv/iptv_auto.c @@ -101,6 +101,7 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in, htsmsg_t *conf; mpegts_mux_t *mm; iptv_mux_t *im; + iptv_service_t *ms; url_t u; int change; http_arg_list_t args; @@ -215,8 +216,12 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in, conf = htsmsg_create_map(); htsmsg_add_str(conf, "iptv_url", url); + if (n) + htsmsg_add_str(conf, "iptv_muxname", n); if (name) htsmsg_add_str(conf, "iptv_sname", name); + if (!in->in_scan_create) + htsmsg_add_s32(conf, "scan_result", MM_SCAN_OK); im = iptv_mux_create0(in, NULL, conf); htsmsg_destroy(conf); @@ -226,6 +231,16 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in, (*count)++; } + if (in->in_service_id) { + conf = htsmsg_create_map(); + htsmsg_add_u32(conf, "sid", in->in_service_id); + htsmsg_add_u32(conf, "dvb_servicetype", 1); /* SDTV */ + ms = iptv_service_create0(im, 0, 0, NULL, conf); + htsmsg_destroy(conf); + if (ms) + iptv_bouquet_trigger(in, 0); + } + end: free(x); urlreset(&u); diff --git a/src/input/mpegts/iptv/iptv_private.h b/src/input/mpegts/iptv/iptv_private.h index 5415a26af..12c8c452c 100644 --- a/src/input/mpegts/iptv/iptv_private.h +++ b/src/input/mpegts/iptv/iptv_private.h @@ -74,9 +74,12 @@ struct iptv_network int in_bps; int in_bw_limited; + int in_scan_create; int in_priority; int in_streaming_priority; + uint16_t in_service_id; + uint32_t in_max_streams; uint32_t in_max_bandwidth; uint32_t in_max_timeout; -- 2.47.3