1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

- correct style

- bug in header check
This commit is contained in:
none 2020-08-29 14:34:53 +02:00
parent ed8bb5af82
commit bb5e9e7f39

View File

@ -25,35 +25,29 @@ uint8_t cc[8192] = { 0 };
void proc_ts(int i, uint8_t *buf) void proc_ts(int i, uint8_t *buf)
{ {
uint16_t pid=0x1fff&((buf[1]<<8)|buf[2]); uint16_t pid= 0x1fff& ((buf[1] << 8) | buf[2]);
uint8_t ccin = buf[3] & 0x1F; uint8_t ccin = buf[3] & 0x1f;
if( buf[0] == 0x47 && (buf[1] & 0x80) == 0) if( buf[0] == 0x47 && (buf[1] & 0x80) == 0) {
{ if( pid != 8191 ) {
if( pid != 8191 ) if (ccin & 0x10) {
{ if( cc[pid] != 0 ) {
if( ccin != 0 )
{
if( cc[pid] != 0 )
{
// TODO: 1 repetition allowed // TODO: 1 repetition allowed
if( ( ccin & 0x10 ) != 0 && (((cc[pid] + 1) & 0x0F) != (ccin & 0x0F)) ) if ((((cc[pid] + 1) & 0x0F) != (ccin & 0x0F)) )
cc_errors += 1; cc_errors += 1;
} }
cc[pid] = ccin; cc[pid] = ccin;
} }
payload_packets += 1; payload_packets += 1;
} }
} } else
else
packet_errors += 1; packet_errors += 1;
if( (packets & 0x3FFF ) == 0) if( (packets & 0x3FFF ) == 0) {
{ printf("%s Packets: %12u non null %12u, errors: %12u, CC errors: %12u%s",
printf("%s Packets: %12u non null %12u, errors: %12u, CC errors: %12u%s", line_start, packets, payload_packets, packet_errors, cc_errors, line_end); line_start, packets, payload_packets, packet_errors, cc_errors, line_end);
fflush(stdout); fflush(stdout);
} }
packets += 1; packets += 1;
} }