|
From: <lin...@us...> - 2002-06-27 20:21:03
|
Update of /cvsroot/dvbtools/dvbtune
In directory usw-pr-cvs1:/tmp/cvs-serv2172
Modified Files:
dvbtune.c
Log Message:
PMT parsing patch by Douglas Kosovic
Index: dvbtune.c
===================================================================
RCS file: /cvsroot/dvbtools/dvbtune/dvbtune.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dvbtune.c 12 Jun 2002 21:56:49 -0000 1.3
--- dvbtune.c 27 Jun 2002 20:20:47 -0000 1.4
***************
*** 40,43 ****
--- 40,44 ----
#include <stdio.h>
#include <stdlib.h>
+ #include <string.h>
#include <ctype.h>
#include <sys/ioctl.h>
***************
*** 696,701 ****
int fd_pmt;
int n,seclen;
! int i,k;
! int max_k;
unsigned char buf[4096];
struct dmxSctFilterParams sctFilterParams;
--- 697,701 ----
int fd_pmt;
int n,seclen;
! int i;
unsigned char buf[4096];
struct dmxSctFilterParams sctFilterParams;
***************
*** 734,739 ****
return;
}
! max_k=1;
! for (k=0;k<max_k;k++) {
if (read(fd_pmt,buf,3)==3) {
seclen=((buf[1] & 0x0f) << 8) | (buf[2] & 0xff);
--- 734,738 ----
return;
}
!
if (read(fd_pmt,buf,3)==3) {
seclen=((buf[1] & 0x0f) << 8) | (buf[2] & 0xff);
***************
*** 745,749 ****
// printf("<service id=\"%d\" pmt_pid=\"%d\">\n",service_id,pid);
! max_k=buf[7]+1; // last_sec_num - read this many (+1) sections
info_len=((buf[10]&0x0f)<<8)|buf[11];
i=12;
--- 744,753 ----
// printf("<service id=\"%d\" pmt_pid=\"%d\">\n",service_id,pid);
! if (sid != service_id) {
! close(fd_pmt);
! scan_pmt(pid, sid, change);
! return;
! }
!
info_len=((buf[10]&0x0f)<<8)|buf[11];
i=12;
***************
*** 774,784 ****
} else {
printf("Under-read bytes for PMT - wanted %d, got %d\n",seclen,n);
- close(fd_pmt);
}
} else {
fprintf(stderr,"Nothing to read from fd_pmt\n");
}
! }
! close(fd_pmt);
}
--- 778,787 ----
} else {
printf("Under-read bytes for PMT - wanted %d, got %d\n",seclen,n);
}
} else {
fprintf(stderr,"Nothing to read from fd_pmt\n");
}
!
! close(fd_pmt);
}
|