Revision e34a5996 libavformat/dv.c

View differences:

libavformat/dv.c
474 474
    return 0;
475 475
}
476 476

  
477
static int dv_probe(AVProbeData *p)
478
{
479
    unsigned state;
480
    int i;
481

  
482
    if (p->buf_size < 5)
483
        return 0;
484

  
485
    state = AV_RB32(p->buf);
486
    for (i = 4; i < p->buf_size; i++) {
487
        if ((state & 0xffffff7f) == 0x1f07003f)
488
            return AVPROBE_SCORE_MAX*3/4; // not max to avoid dv in mov to match
489
        state = (state << 8) | p->buf[i];
490
    }
491

  
492
    return 0;
493
}
494

  
477 495
#if CONFIG_DV_DEMUXER
478 496
AVInputFormat dv_demuxer = {
479 497
    "dv",
480 498
    NULL_IF_CONFIG_SMALL("DV video format"),
481 499
    sizeof(RawDVContext),
482
    NULL,
500
    dv_probe,
483 501
    dv_read_header,
484 502
    dv_read_packet,
485 503
    dv_read_close,

Also available in: Unified diff