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

Loading…
Cancel
Save