diff recpt1/recpt1.c @ 127:8e0f7191b92e

Imported PID re-acquisition code by Toshiyuki Kawashima <tos@fa2.so-net.ne.jp>. The original patch can be obtained from http://www.castanet.homeip.net/~tos/wiki/index.php
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 12 Mar 2012 22:22:27 +0900
parents a910b49dfbee
children b14397800eae
line wrap: on
line diff
--- a/recpt1/recpt1.c	Mon Mar 05 09:46:50 2012 +0900
+++ b/recpt1/recpt1.c	Mon Mar 12 22:22:27 2012 +0900
@@ -175,7 +175,7 @@
 create_queue(size_t size)
 {
     QUEUE_T *p_queue;
-    int memsize = sizeof(QUEUE_T) + size * sizeof(BUFSZ);
+    int memsize = sizeof(QUEUE_T) + size * sizeof(BUFSZ*);
 
     p_queue = (QUEUE_T*)calloc(memsize, sizeof(char));
 
@@ -314,7 +314,7 @@
     pthread_t signal_thread = data->signal_thread;
     struct sockaddr_in *addr = NULL;
     BUFSZ *qbuf;
-    splitbuf_t splitbuf;
+    static splitbuf_t splitbuf;
     ARIB_STD_B25_BUFFER sbuf, dbuf, buf;
     int code;
     int split_select_finish = TSS_ERROR;
@@ -384,7 +384,10 @@
                 }
                 /* $BJ,N%BP>]0J30$r$U$k$$Mn$H$9(B */
                 code = split_ts(splitter, &buf, &splitbuf);
-                if(code != TSS_SUCCESS) {
+                if(code == TSS_NULL) {
+                    fprintf(stderr, "PMT reading..\n");
+                }
+                else if(code != TSS_SUCCESS) {
                     fprintf(stderr, "split_ts failed\n");
                     break;
                 }
@@ -456,7 +459,12 @@
             if(use_splitter) {
                 /* $BJ,N%BP>]0J30$r$U$k$$Mn$H$9(B */
                 code = split_ts(splitter, &buf, &splitbuf);
-                if(code != TSS_SUCCESS) {
+                if(code == TSS_NULL) {
+                    split_select_finish = TSS_ERROR;
+                    fprintf(stderr, "PMT reading..\n");
+                }
+                else if(code != TSS_SUCCESS) {
+                    fprintf(stderr, "split_ts failed\n");
                     break;
                 }