Browse Source

Remove --camd-pkt-delay (-y) option.

This workaround is no longer needed because camd socket is now set
TCP_NODELAY and this fixes OSCAM communication.
Georgi Chorbadzhiyski 12 years ago
parent
commit
a9ee2ed0d0
7 changed files with 2 additions and 33 deletions
  1. 1
    0
      ChangeLog
  2. 0
    2
      README
  3. 0
    12
      camd.c
  4. 0
    2
      data.c
  5. 0
    2
      data.h
  6. 0
    5
      tsdecrypt.1
  7. 1
    10
      tsdecrypt.c

+ 1
- 0
ChangeLog View File

@@ -1,4 +1,5 @@
1 1
 xxxx-xx-xx : Version next
2
+ * Remove --camd-pkt-delay (-y) option. This workaround is no longer needed.
2 3
  * Fix payload offset detection, a bug which broke packets that have
3 4
    adaptation with whole packet size (libtsfuncs).
4 5
  * Add --input-service option, to choose service id (program) in MPTS input.

+ 0
- 2
README View File

@@ -58,8 +58,6 @@ CAMD server options:
58 58
  -s --camd-server <addr>    | Set CAMD server ip address and port (1.2.3.4:2233).
59 59
  -U --camd-user <user>      | Set CAMD server user. Default: user
60 60
  -P --camd-pass <pass>      | Set CAMD server password. Default: pass
61
- -y --camd-pkt-delay <us>   | Sleep <us> usec between sending ECM/EMM
62
-                            .   packets to CAMD. Default: 0
63 61
 
64 62
 EMM options:
65 63
  -e --emm                   | Enable sending EMM's to CAMD. Default: disabled

+ 0
- 12
camd.c View File

@@ -250,12 +250,6 @@ static int camd35_send_ecm(struct ts *ts, uint16_t ca_id, uint16_t service_id, u
250 250
 	c->buf[18] = 0xff;
251 251
 	c->buf[19] = 0xff;
252 252
 
253
-	// OSCAM do not like it if ECM's are comming too fast
254
-	// It thinks they are part of a single packet and ignores
255
-	// the data at the end. The usleep() is a hack but works
256
-	if (ts->packet_delay)
257
-		usleep(ts->packet_delay);
258
-
259 253
 	int ret = camd35_send_buf(ts, to_send);
260 254
 	if (ret <= 0) {
261 255
 		ts_LOGf("ERR | Error sending ecm packet, reconnecting to camd.\n");
@@ -290,12 +284,6 @@ static int camd35_send_emm(struct ts *ts, uint16_t ca_id, uint8_t *data, uint8_t
290 284
 	init_2b(ca_id  , c->buf + 10);
291 285
 	init_4b(prov_id, c->buf + 12);
292 286
 
293
-	// OSCAM do not like it if EMM's are comming too fast
294
-	// It thinks they are part of a single packet and ignores
295
-	// the data at the end. The usleep() is a hack but works
296
-	if (ts->packet_delay)
297
-		usleep(ts->packet_delay);
298
-
299 287
 	int ret = camd35_send_buf(ts, to_send);
300 288
 	if (ret < 0) {
301 289
 		c->emm_recv_errors++;

+ 0
- 2
data.c View File

@@ -74,8 +74,6 @@ void data_init(struct ts *ts) {
74 74
 	ts->emm_send    = 0;
75 75
 	ts->pid_filter  = 1;
76 76
 
77
-	ts->packet_delay = 0;
78
-
79 77
 	ts->emm_report_interval = 60;
80 78
 	ts->emm_last_report     = time(NULL);
81 79
 

+ 0
- 2
data.h View File

@@ -175,8 +175,6 @@ struct ts {
175 175
 
176 176
 	int					threaded;
177 177
 
178
-	int					packet_delay;
179
-
180 178
 	int					decode_stop;
181 179
 	pthread_t			decode_thread;
182 180
 	CBUF				*decode_buf;

+ 0
- 5
tsdecrypt.1 View File

@@ -120,11 +120,6 @@ Set CAMD user name. The default is \fBuser\fR.
120 120
 \fB\-P\fR, \fB\-\-camd\-pass\fR <password>
121 121
 Set CAMD user password. The default is \fBpass\fR.
122 122
 .TP
123
-\fB\-y\fR, \fB\-\-camd\-pkt\-delay\fR <usec>
124
-Sleep <usec> microseconds between sending ECM/EMM packets to CAMD. This
125
-is workaround for camd35 OSCAM protocol processing. The default sleep time
126
-is \fB0\fR (workaround is disabled).
127
-.TP
128 123
 .SH EMM OPTIONS
129 124
 .PP
130 125
 .TP

+ 1
- 10
tsdecrypt.c View File

@@ -77,7 +77,6 @@ static const struct option long_options[] = {
77 77
 	{ "camd-server",		required_argument, NULL, 's' },
78 78
 	{ "camd-user",			required_argument, NULL, 'U' },
79 79
 	{ "camd-pass",			required_argument, NULL, 'P' },
80
-	{ "camd-pkt-delay",		required_argument, NULL, 'y' },
81 80
 
82 81
 	{ "emm",				no_argument,       NULL, 'e' },
83 82
 	{ "emm-pid",			required_argument, NULL, 'Z' },
@@ -141,8 +140,6 @@ static void show_help(struct ts *ts) {
141 140
 	printf(" -s --camd-server <addr>    | Set CAMD server ip address and port (1.2.3.4:2233).\n");
142 141
 	printf(" -U --camd-user <user>      | Set CAMD server user. Default: %s\n", ts->camd35.user);
143 142
 	printf(" -P --camd-pass <pass>      | Set CAMD server password. Default: %s\n", ts->camd35.pass);
144
-	printf(" -y --camd-pkt-delay <us>   | Sleep <us> usec between sending ECM/EMM\n");
145
-	printf("                            .   packets to CAMD. Default: %d\n", ts->packet_delay);
146 143
 	printf("\n");
147 144
 	printf("EMM options:\n");
148 145
 	printf(" -e --emm                   | Enable sending EMM's to CAMD. Default: %s\n", ts->emm_send ? "enabled" : "disabled");
@@ -304,11 +301,6 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
304 301
 				strncpy(ts->camd35.pass, optarg, sizeof(ts->camd35.pass) - 1);
305 302
 				ts->camd35.pass[sizeof(ts->camd35.pass) - 1] = 0;
306 303
 				break;
307
-			case 'y':
308
-				ts->packet_delay = atoi(optarg);
309
-				if (ts->packet_delay < 0 || ts->packet_delay > 1000000)
310
-					ts->packet_delay = 0;
311
-				break;
312 304
 
313 305
 			case 'e':
314 306
 				ts->emm_send = !ts->emm_send;
@@ -429,8 +421,7 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
429 421
 	ts_LOGf("Server addr: tcp://%s:%u/\n", inet_ntoa(ts->camd35.server_addr), ts->camd35.server_port);
430 422
 	ts_LOGf("Server user: %s\n", ts->camd35.user);
431 423
 	ts_LOGf("Server pass: %s\n", ts->camd35.pass);
432
-	if (ts->packet_delay)
433
-		ts_LOGf("Pkt sleep  : %d us (%d ms)\n", ts->packet_delay, ts->packet_delay / 1000);
424
+
434 425
 	ts_LOGf("TS discont : %s\n", ts->ts_discont ? "report" : "ignore");
435 426
 	ts->threaded = !(ts->input.type == FILE_IO && ts->input.fd != 0);
436 427
 	if (ts->emm_send && ts->emm_report_interval)

Loading…
Cancel
Save