Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bouquet: notify channels on lcn offset change
  • Loading branch information
perexg committed Nov 8, 2014
1 parent 7b086cb commit 75cdc28
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/bouquet.c
Expand Up @@ -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);
}
}

/**
*
*/
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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 )
{
Expand Down Expand Up @@ -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,
},
{}
}
Expand Down
1 change: 1 addition & 0 deletions src/bouquet.h
Expand Up @@ -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);

Expand Down

0 comments on commit 75cdc28

Please sign in to comment.