Revision 6982462f libavformat/mxf.c

View differences:

libavformat/mxf.c
637 637
    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },       CODEC_ID_NONE, Frame },
638 638
};
639 639

  
640
/*
641
 * Match an uid independently of the version byte and up to len common bytes
642
 * Returns: boolean
643
 */
644
static int mxf_match_uid(const UID key, const UID uid, int len)
645
{
646
    int i;
647
    for (i = 0; i < len; i++) {
648
        if (i != 7 && key[i] != uid[i])
649
            return 0;
650
    }
651
    return 1;
652
}
653

  
640 654
static const MXFCodecUL *mxf_get_codec_ul(const MXFCodecUL *uls, UID *uid)
641 655
{
642 656
    while (uls->id != CODEC_ID_NONE) {
643
        if(!memcmp(uls->uid, *uid, 16))
657
        if(mxf_match_uid(uls->uid, *uid, 16))
644 658
            break;
645 659
        uls++;
646 660
    }
......
650 664
static enum CodecType mxf_get_codec_type(const MXFDataDefinitionUL *uls, UID *uid)
651 665
{
652 666
    while (uls->type != CODEC_TYPE_DATA) {
653
        if(!memcmp(uls->uid, *uid, 16))
667
        if(mxf_match_uid(uls->uid, *uid, 16))
654 668
            break;
655 669
        uls++;
656 670
    }

Also available in: Unified diff