|
From: <lin...@us...> - 2002-06-26 20:41:08
|
Update of /cvsroot/dvbtools/dvbts2pes
In directory usw-pr-cvs1:/tmp/cvs-serv19942
Modified Files:
dvbts2pes.c
Log Message:
first use of discontinuity_indicator
Index: dvbts2pes.c
===================================================================
RCS file: /cvsroot/dvbtools/dvbts2pes/dvbts2pes.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dvbts2pes.c 26 Jun 2002 19:32:58 -0000 1.3
--- dvbts2pes.c 26 Jun 2002 20:41:04 -0000 1.4
***************
*** 99,102 ****
--- 99,103 ----
int adaption_field_control,continuity_counter;
int adaption_field_length;
+ int discontinuity_indicator;
int max_pes=0;
int min_pes=9999999;
***************
*** 104,107 ****
--- 105,109 ----
int pes_dropped=0;
int ts_dropped=0;
+ int pes_dirty;
if (argc==2) {
***************
*** 137,140 ****
--- 139,151 ----
continuity_counter=buf[3]&0x0f;
adaption_field_control=(buf[3]&0x30)>>4;
+ discontinuity_indicator=0;
+ if ((adaption_field_control==2) || (adaption_field_control==3)) {
+ if (buf[4] > 0) { // adaption_field_length
+ discontinuity_indicator=(buf[5]&0x80)>>7;
+ }
+ }
+ if (discontinuity_indicator) {
+ fprintf(stderr,"INFORMATION: packet %d - discontinuity_indicator set\n",packet);
+ }
/* Firstly, check the integrity of the stream */
***************
*** 142,153 ****
counter=continuity_counter;
} else {
! counter++; counter%=16;
}
if (counter!=continuity_counter) {
! n=(continuity_counter+16-counter)%16;
! fprintf(stderr,"TS: missing %d packet(s), packet=%d, expecting %02x, received %02x\n",n,packet,counter,continuity_counter);
! ts_dropped+=n;
counter=continuity_counter;
}
--- 153,169 ----
counter=continuity_counter;
} else {
! if ((adaption_field_control!=0) && (adaption_field_control!=2)) {
! counter++; counter%=16;
! }
}
if (counter!=continuity_counter) {
! if (discontinuity_indicator==0) {
! n=(continuity_counter+16-counter)%16;
! fprintf(stderr,"TS: missing %d packet(s), packet=%d, expecting %02x, received %02x afc=%d, di=%d\n",n,packet,counter,continuity_counter,adaption_field_control,discontinuity_indicator);
! ts_dropped+=n;
! pes_dirty=1;
! }
counter=continuity_counter;
}
***************
*** 158,162 ****
// fprintf(stderr,"previous peslength=%d\n",peslength);
if (ts_status==TS_IN_PAYLOAD) {
! if (check_pes(pesbuf,peslength)) {
c=0;
while (c<peslength) {
--- 174,178 ----
// fprintf(stderr,"previous peslength=%d\n",peslength);
if (ts_status==TS_IN_PAYLOAD) {
! if ((pes_dirty==0) && (check_pes(pesbuf,peslength))) {
c=0;
while (c<peslength) {
***************
*** 169,174 ****
--- 185,192 ----
pes_written++;
} else {
+ fprintf(stderr,"Dropped PES packet\n");
pes_dropped++;
}
+ pes_dirty=0;
} else {
ts_status=TS_IN_PAYLOAD;
|