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

@ -26,34 +26,28 @@ uint8_t cc[8192] = { 0 };
void proc_ts(int i, uint8_t *buf)
{
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( pid != 8191 )
{
if( ccin != 0 )
{
if( cc[pid] != 0 )
{
if( buf[0] == 0x47 && (buf[1] & 0x80) == 0) {
if( pid != 8191 ) {
if (ccin & 0x10) {
if( cc[pid] != 0 ) {
// 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[pid] = ccin;
}
payload_packets += 1;
}
}
else
} else
packet_errors += 1;
if( (packets & 0x3FFF ) == 0)
{
printf("%s Packets: %12u non null %12u, errors: %12u, CC errors: %12u%s", line_start, packets, payload_packets, packet_errors, cc_errors, line_end);
if( (packets & 0x3FFF ) == 0) {
printf("%s Packets: %12u non null %12u, errors: %12u, CC errors: %12u%s",
line_start, packets, payload_packets, packet_errors, cc_errors, line_end);
fflush(stdout);
}
packets += 1;
}