Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: Add 'Scan After Create' and 'Service ID' fields to network
  • Loading branch information
perexg committed Oct 16, 2015
1 parent 52a1e2e commit f2f9bcf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/input/mpegts/iptv/iptv.c
Expand Up @@ -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",
Expand Down Expand Up @@ -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");
Expand Down
15 changes: 15 additions & 0 deletions src/input/mpegts/iptv/iptv_auto.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/input/mpegts/iptv/iptv_private.h
Expand Up @@ -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;
Expand Down

0 comments on commit f2f9bcf

Please sign in to comment.