Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
server: Add the CAID column to make possible to filter services again…
…st CAID - fixes #2153
  • Loading branch information
perexg committed Aug 13, 2014
1 parent 39c202c commit 1579757
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/input/mpegts/mpegts_service.c
Expand Up @@ -130,12 +130,12 @@ const idclass_t mpegts_service_class =
.off = offsetof(mpegts_service_t, s_dvb_servicetype),
},
{
.type = PT_STR,
.id = "charset",
.name = "Character Set",
.off = offsetof(mpegts_service_t, s_dvb_charset),
.list = dvb_charset_enum,
.opts = PO_ADVANCED,
.type = PT_STR,
.id = "charset",
.name = "Character Set",
.off = offsetof(mpegts_service_t, s_dvb_charset),
.list = dvb_charset_enum,
.opts = PO_ADVANCED,
},
{
.type = PT_U16,
Expand Down
33 changes: 33 additions & 0 deletions src/service.c
Expand Up @@ -142,6 +142,32 @@ service_class_encrypted_get ( void *p )
return &t;
}

static const void *
service_class_caid_get ( void *obj )
{
static char buf[256], *s = buf;
service_t *svc = obj;
elementary_stream_t *st;
caid_t *c;
size_t l;

buf[0] = '\0';
TAILQ_FOREACH(st, &svc->s_components, es_link) {
switch(st->es_type) {
case SCT_CA:
LIST_FOREACH(c, &st->es_caids, link) {
l = strlen(buf);
snprintf(buf + l, l - sizeof(buf), "%s%04X:%06X",
l ? "," : "", c->caid, c->providerid);
}
break;
default:
break;
}
}
return &s;
}

const idclass_t service_class = {
.ic_class = "service",
.ic_caption = "Service",
Expand Down Expand Up @@ -172,6 +198,13 @@ const idclass_t service_class = {
.get = service_class_encrypted_get,
.opts = PO_NOSAVE | PO_RDONLY
},
{
.type = PT_STR,
.id = "caid",
.name = "CAID",
.get = service_class_caid_get,
.opts = PO_NOSAVE | PO_RDONLY | PO_HIDDEN,
},
{}
}
};
Expand Down

0 comments on commit 1579757

Please sign in to comment.