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