tvh_binshasum[18],
tvh_binshasum[19]);
+ tvh_mutex_lock(&global_lock);
dumpchannels(hq);
+ tvh_mutex_unlock(&global_lock);
http_output_content(hc, "text/plain; charset=UTF-8");
return 0;
mpegts_mux_t *mm = NULL;
#endif
const char *str;
- int weight = 0;
+ int weight = 0, r;
hc->hc_keep_alive = 0;
if ((str = http_arg_get(&hc->hc_req_args, "weight")))
weight = atoi(str);
+ tvh_mutex_lock(&global_lock);
+
if(!strcmp(components[0], "channelid")) {
ch = channel_find_by_id(atoi(components[1]));
} else if(!strcmp(components[0], "channelnumber")) {
}
if(ch != NULL) {
- return http_stream_channel(hc, ch, weight);
+ r = http_stream_channel(hc, ch, weight);
} else if(service != NULL) {
- return http_stream_service(hc, service, weight);
+ r = http_stream_service(hc, service, weight);
#if ENABLE_MPEGTS
} else if(mm != NULL) {
- return http_stream_mux(hc, mm, weight);
+ r = http_stream_mux(hc, mm, weight);
#endif
} else {
- return HTTP_STATUS_BAD_REQUEST;
+ r = HTTP_STATUS_BAD_REQUEST;
}
+
+ tvh_mutex_unlock(&global_lock);
+ return r;
}
/**