Browse Source

camd: Do not stop ECM/EMM processing thread when the incomming message is NULL.

If the message is NULL just continue. Breaking out of the loop is
wrong because it stops the ecm/processing thread and leaves tsdecrypt
in a non working state.
Georgi Chorbadzhiyski 12 years ago
parent
commit
e886424c58
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      camd.c

+ 6
- 2
camd.c View File

217
 	while (1) {
217
 	while (1) {
218
 		struct camd_msg *msg;
218
 		struct camd_msg *msg;
219
 		void *req = queue_get(ts->camd.req_queue); // Waits...
219
 		void *req = queue_get(ts->camd.req_queue); // Waits...
220
-		if (!req || ts->camd_stop)
220
+		if (ts->camd_stop)
221
 			break;
221
 			break;
222
+		if (!req)
223
+			continue;
222
 		msg = queue_get_nowait(ts->camd.ecm_queue);
224
 		msg = queue_get_nowait(ts->camd.ecm_queue);
223
 		if (!msg)
225
 		if (!msg)
224
 			msg = queue_get_nowait(ts->camd.emm_queue);
226
 			msg = queue_get_nowait(ts->camd.emm_queue);
225
 		if (!msg)
227
 		if (!msg)
226
-			break;
228
+			continue;
227
 		camd_do_msg(msg);
229
 		camd_do_msg(msg);
228
 
230
 
229
 		if (ts->camd.ecm_queue->items >= ECM_QUEUE_HARD_LIMIT) {
231
 		if (ts->camd.ecm_queue->items >= ECM_QUEUE_HARD_LIMIT) {
259
 }
261
 }
260
 
262
 
261
 void camd_process_packet(struct ts *ts, struct camd_msg *msg) {
263
 void camd_process_packet(struct ts *ts, struct camd_msg *msg) {
264
+	if (!msg)
265
+		return;
262
 	msg->ts = ts;
266
 	msg->ts = ts;
263
 	if (ts->camd.thread) {
267
 	if (ts->camd.thread) {
264
 		if (msg->type == EMM_MSG)
268
 		if (msg->type == EMM_MSG)

Loading…
Cancel
Save