comparison 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
comparison
equal deleted inserted replaced
126:bb93a7c0ff5d 127:8e0f7191b92e
173 173
174 QUEUE_T * 174 QUEUE_T *
175 create_queue(size_t size) 175 create_queue(size_t size)
176 { 176 {
177 QUEUE_T *p_queue; 177 QUEUE_T *p_queue;
178 int memsize = sizeof(QUEUE_T) + size * sizeof(BUFSZ); 178 int memsize = sizeof(QUEUE_T) + size * sizeof(BUFSZ*);
179 179
180 p_queue = (QUEUE_T*)calloc(memsize, sizeof(char)); 180 p_queue = (QUEUE_T*)calloc(memsize, sizeof(char));
181 181
182 if(p_queue != NULL) { 182 if(p_queue != NULL) {
183 p_queue->size = size; 183 p_queue->size = size;
312 boolean use_splitter = splitter ? TRUE : FALSE; 312 boolean use_splitter = splitter ? TRUE : FALSE;
313 int sfd = -1; 313 int sfd = -1;
314 pthread_t signal_thread = data->signal_thread; 314 pthread_t signal_thread = data->signal_thread;
315 struct sockaddr_in *addr = NULL; 315 struct sockaddr_in *addr = NULL;
316 BUFSZ *qbuf; 316 BUFSZ *qbuf;
317 splitbuf_t splitbuf; 317 static splitbuf_t splitbuf;
318 ARIB_STD_B25_BUFFER sbuf, dbuf, buf; 318 ARIB_STD_B25_BUFFER sbuf, dbuf, buf;
319 int code; 319 int code;
320 int split_select_finish = TSS_ERROR; 320 int split_select_finish = TSS_ERROR;
321 321
322 buf.size = 0; 322 buf.size = 0;
382 break; 382 break;
383 } 383 }
384 } 384 }
385 /* $BJ,N%BP>]0J30$r$U$k$$Mn$H$9(B */ 385 /* $BJ,N%BP>]0J30$r$U$k$$Mn$H$9(B */
386 code = split_ts(splitter, &buf, &splitbuf); 386 code = split_ts(splitter, &buf, &splitbuf);
387 if(code != TSS_SUCCESS) { 387 if(code == TSS_NULL) {
388 fprintf(stderr, "PMT reading..\n");
389 }
390 else if(code != TSS_SUCCESS) {
388 fprintf(stderr, "split_ts failed\n"); 391 fprintf(stderr, "split_ts failed\n");
389 break; 392 break;
390 } 393 }
391 394
392 break; 395 break;
454 } 457 }
455 458
456 if(use_splitter) { 459 if(use_splitter) {
457 /* $BJ,N%BP>]0J30$r$U$k$$Mn$H$9(B */ 460 /* $BJ,N%BP>]0J30$r$U$k$$Mn$H$9(B */
458 code = split_ts(splitter, &buf, &splitbuf); 461 code = split_ts(splitter, &buf, &splitbuf);
459 if(code != TSS_SUCCESS) { 462 if(code == TSS_NULL) {
463 split_select_finish = TSS_ERROR;
464 fprintf(stderr, "PMT reading..\n");
465 }
466 else if(code != TSS_SUCCESS) {
467 fprintf(stderr, "split_ts failed\n");
460 break; 468 break;
461 } 469 }
462 470
463 buf.data = splitbuf.buffer; 471 buf.data = splitbuf.buffer;
464 buf.size = splitbuf.size; 472 buf.size = splitbuf.size;