descrambler_notify_deliver( mpegts_service_t *t, descramble_info_t *di, int locked )
{
streaming_message_t *sm;
+ int r;
+ pthread_mutex_lock(&t->s_stream_mutex);
if (!t->s_descramble_info)
t->s_descramble_info = calloc(1, sizeof(*di));
- if (memcmp(t->s_descramble_info, di, sizeof(*di)) == 0) {
+ r = memcmp(t->s_descramble_info, di, sizeof(*di));
+ pthread_mutex_unlock(&t->s_stream_mutex);
+ if (r == 0) { /* identical */
free(di);
return;
}
{
htsmsg_t *m = htsmsg_create_map();
descramble_info_t *di;
+ service_t *t;
profile_t *pro;
char buf[256];
if(s->ths_channel != NULL)
htsmsg_add_str(m, "channel", channel_get_name(s->ths_channel));
- if(s->ths_service != NULL) {
- htsmsg_add_str(m, "service", s->ths_service->s_nicename ?: "");
+ if((t = s->ths_service) != NULL) {
+ htsmsg_add_str(m, "service", t->s_nicename ?: "");
+ pthread_mutex_lock(&t->s_stream_mutex);
if ((di = s->ths_service->s_descramble_info) != NULL) {
if (di->caid == 0 && di->ecmtime == 0) {
snprintf(buf, sizeof(buf), N_("Failed"));
}
htsmsg_add_str(m, "descramble", buf);
}
+ pthread_mutex_unlock(&t->s_stream_mutex);
if (s->ths_prch != NULL) {
pro = s->ths_prch->prch_pro;