Fixes Ticket5566
Unified · Split
| @@ -542,13 +542,16 @@ static int analyze(const uint8_t *buf, int size, int packet_size, · 541 unmodified lines | ||
| 542 | 542 | memset(stat, 0, packet_size * sizeof(*stat)); |
| 543 | 543 | |
| 544 | 544 | for (i = 0; i < size - 3; i++) { |
| 545 | − if (buf[i] == 0x47 && | |
| 546 | − (!probe || (buf[i + 3] & 0x30))) { | |
| 547 | − int x = i % packet_size; | |
| 548 | − stat[x]++; | |
| 549 | − stat_all++; | |
| 550 | − if (stat[x] > best_score) { | |
| 551 | − best_score = stat[x]; | |
| 545 | + if (buf[i] == 0x47) { | |
| 546 | + int pid = AV_RB16(buf+1) & 0x1FFF; | |
| 547 | + int asc = buf[i + 3] & 0x30; | |
| 548 | + if (!probe || pid == 0x1FFF || asc) { | |
| 549 | + int x = i % packet_size; | |
| 550 | + stat[x]++; | |
| 551 | + stat_all++; | |
| 552 | + if (stat[x] > best_score) { | |
| 553 | + best_score = stat[x]; | |
| 554 | + } | |
| 552 | 555 | } |
| 553 | 556 | } |
| 554 | 557 | } |