Revision f6765f3f

View differences:

libavformat/dv.c
489 489
    unsigned state, marker_pos = 0;
490 490
    int i;
491 491
    int matches = 0;
492
    int secondary_matches = 0;
492 493

  
493 494
    if (p->buf_size < 5)
494 495
        return 0;
......
497 498
    for (i = 4; i < p->buf_size; i++) {
498 499
        if ((state & 0xffffff7f) == 0x1f07003f)
499 500
            matches++;
501
        // any section header, also with seq/chan num != 0,
502
        // should appear around every 12000 bytes, at least 10 per frame
503
        if ((state & 0xff07ff7f) == 0x1f07003f)
504
            secondary_matches++;
500 505
        if (state == 0x003f0700 || state == 0xff3f0700)
501 506
            marker_pos = i;
502 507
        if (state == 0xff3f0701 && i - marker_pos == 80)
......
505 510
    }
506 511

  
507 512
    if (matches && p->buf_size / matches < 1024*1024) {
508
        if (matches > 4)
513
        if (matches > 4 || (secondary_matches >= 10 && p->buf_size / secondary_matches < 24000))
509 514
            return AVPROBE_SCORE_MAX*3/4; // not max to avoid dv in mov to match
510 515
        return AVPROBE_SCORE_MAX/4;
511 516
    }

Also available in: Unified diff