Browse Source

Log message when there is not data on input.

Georgi Chorbadzhiyski 13 years ago
parent
commit
0070a7c679
2 changed files with 8 additions and 2 deletions
  1. 1
    1
      libfuncs
  2. 7
    1
      tsdecrypt.c

+ 1
- 1
libfuncs

@@ -1 +1 @@
1
-Subproject commit f68888b2d07d55acaafc9882c8e06162e882e263
1
+Subproject commit 82141bd7b73677f69b11dabd131de95b50e6be6e

+ 7
- 1
tsdecrypt.c View File

@@ -389,6 +389,7 @@ void signal_quit(int sig) {
389 389
 
390 390
 int main(int argc, char **argv) {
391 391
 	ssize_t readen;
392
+	int have_data = 1;
392 393
 	uint8_t ts_packet[FRAME_SIZE + RTP_HDR_SZ];
393 394
 	uint8_t rtp_hdr[2][RTP_HDR_SZ];
394 395
 	int rtp_hdr_pos = 0, num_packets = 0;
@@ -432,6 +433,7 @@ int main(int argc, char **argv) {
432 433
 	camd_start(&ts);
433 434
 	do {
434 435
 		if (ts.input.type == NET_IO) {
436
+			set_log_io_errors(0);
435 437
 			if (!ts.rtp_input) {
436 438
 				readen = fdread_ex(ts.input.fd, (char *)ts_packet, FRAME_SIZE, 250, 4, 1);
437 439
 			} else {
@@ -450,14 +452,18 @@ int main(int argc, char **argv) {
450 452
 					num_packets++;
451 453
 				}
452 454
 			}
455
+			set_log_io_errors(1);
456
+			if (readen < 0)
457
+				ts_LOGf("--- | Input read timeout.\n");
453 458
 		} else {
454 459
 			readen = read(ts.input.fd, ts_packet, FRAME_SIZE);
460
+			have_data = !(readen <= 0);
455 461
 		}
456 462
 		if (readen > 0)
457 463
 			process_packets(&ts, ts_packet, readen);
458 464
 		if (!keep_running)
459 465
 			break;
460
-	} while (readen > 0);
466
+	} while (have_data);
461 467
 EXIT:
462 468
 	camd_stop(&ts);
463 469
 

Loading…
Cancel
Save