Revision 6377de61 libavformat/dv.c

View differences:

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

  
492 493
    if (p->buf_size < 5)
493 494
        return 0;
......
495 496
    state = AV_RB32(p->buf);
496 497
    for (i = 4; i < p->buf_size; i++) {
497 498
        if ((state & 0xffffff7f) == 0x1f07003f)
498
            return AVPROBE_SCORE_MAX*3/4; // not max to avoid dv in mov to match
499
            matches++;
499 500
        if (state == 0x003f0700 || state == 0xff3f0700)
500 501
            marker_pos = i;
501 502
        if (state == 0xff3f0701 && i - marker_pos == 80)
502
            return AVPROBE_SCORE_MAX/4;
503
            matches++;
503 504
        state = (state << 8) | p->buf[i];
504 505
    }
505 506

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

  

Also available in: Unified diff