mpegts: add # Channels to networks and muxes, fixes #2366

This commit is contained in:
Jaroslav Kysela 2014-10-16 12:08:32 +02:00
parent a4d364bcb7
commit b72ad69e66
2 changed files with 50 additions and 0 deletions

View file

@ -21,6 +21,7 @@
#include "queue.h"
#include "input.h"
#include "subscriptions.h"
#include "channels.h"
#include "access.h"
#include "dvb_charset.h"
@ -201,6 +202,22 @@ mpegts_mux_class_get_num_svc ( void *ptr )
return &n;
}
static const void *
mpegts_mux_class_get_num_chn ( void *ptr )
{
static int n;
mpegts_mux_t *mm = ptr;
mpegts_service_t *s;
channel_service_mapping_t *csm;
n = 0;
LIST_FOREACH(s, &mm->mm_services, s_dvb_mux_link)
LIST_FOREACH(csm, &s->s_channels, csm_svc_link)
n++;
return &n;
}
static const void *
mpegts_mux_class_get_network ( void *ptr )
{
@ -409,6 +426,13 @@ const idclass_t mpegts_mux_class =
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_mux_class_get_num_svc,
},
{
.type = PT_INT,
.id = "num_chn",
.name = "# Channels",
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_mux_class_get_num_chn,
},
{
.type = PT_BOOL,
.id = "pmt_06_ac3",

View file

@ -18,6 +18,7 @@
#include "input.h"
#include "subscriptions.h"
#include "channels.h"
#include "access.h"
#include "dvb_charset.h"
@ -77,6 +78,24 @@ mpegts_network_class_get_num_svc ( void *ptr )
return &n;
}
static const void *
mpegts_network_class_get_num_chn ( void *ptr )
{
static int n;
mpegts_mux_t *mm;
mpegts_service_t *s;
mpegts_network_t *mn = ptr;
channel_service_mapping_t *csm;
n = 0;
LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link)
LIST_FOREACH(s, &mm->mm_services, s_dvb_mux_link)
LIST_FOREACH(csm, &s->s_channels, csm_svc_link)
n++;
return &n;
}
static const void *
mpegts_network_class_get_scanq_length ( void *ptr )
{
@ -180,6 +199,13 @@ const idclass_t mpegts_network_class =
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_network_class_get_num_svc,
},
{
.type = PT_INT,
.id = "num_chn",
.name = "# Channels",
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_network_class_get_num_chn,
},
{
.type = PT_INT,
.id = "scanq_length",