bouquet: notify channels on lcn offset change

This commit is contained in:
Jaroslav Kysela 2014-11-02 16:28:49 +01:00
parent 7b086cbede
commit 75cdc2831b
2 changed files with 29 additions and 3 deletions

View file

@ -286,6 +286,24 @@ bouquet_map_to_channels(bouquet_t *bq)
}
}
/*
*
*/
void
bouquet_notify_channels(bouquet_t *bq)
{
channel_service_mapping_t *csm;
service_t *t;
size_t z;
for (z = 0; z < bq->bq_services->is_count; z++) {
t = (service_t *)bq->bq_services->is_array[z];
LIST_FOREACH(csm, &t->s_channels, csm_svc_link)
if (csm->csm_chn->ch_bouquet == bq)
idnode_notify_simple(&csm->csm_chn->ch_id);
}
}
/**
*
*/
@ -375,7 +393,7 @@ bouquet_class_mapnolcn_notify ( void *obj )
bouquet_unmap_channel(bq, t);
}
} else {
bouquet_map_to_channels((bouquet_t *)obj);
bouquet_map_to_channels(bq);
}
}
@ -393,7 +411,7 @@ bouquet_class_mapnoname_notify ( void *obj )
bouquet_unmap_channel(bq, t);
}
} else {
bouquet_map_to_channels((bouquet_t *)obj);
bouquet_map_to_channels(bq);
}
}
@ -419,10 +437,16 @@ bouquet_class_chtag_notify ( void *obj )
channel_tag_unmap(csm->csm_chn, ct);
}
} else {
bouquet_map_to_channels((bouquet_t *)obj);
bouquet_map_to_channels(bq);
}
}
static void
bouquet_class_lcn_offset_notify ( void *obj )
{
bouquet_notify_channels((bouquet_t *)obj);
}
static const void *
bouquet_class_services_get ( void *obj )
{
@ -554,6 +578,7 @@ const idclass_t bouquet_class = {
.id = "lcn_off",
.name = "Channel Number Offset",
.off = offsetof(bouquet_t, bq_lcn_offset),
.notify = bouquet_class_lcn_offset_notify,
},
{}
}

View file

@ -71,6 +71,7 @@ bouquet_find_by_uuid(const char *uuid)
bouquet_t * bouquet_find_by_source(const char *name, const char *src, int create);
void bouquet_map_to_channels(bouquet_t *bq);
void bouquet_notify_channels(bouquet_t *bq);
void bouquet_add_service(bouquet_t *bq, service_t *s);
void bouquet_completed(bouquet_t *bq);