comparison utils.c @ 2286:5fca908f82ea libavformat

try exact match before case insensitive match in codec_get_id
author michael
date Fri, 27 Jul 2007 11:36:17 +0000
parents ab7f29ef9976
children 80a123ce1501
comparison
equal deleted inserted replaced
2285:a36b77f40ee2 2286:5fca908f82ea
1669 return 0; 1669 return 0;
1670 } 1670 }
1671 1671
1672 enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag) 1672 enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag)
1673 { 1673 {
1674 while (tags->id != CODEC_ID_NONE) { 1674 int i;
1675 if( toupper((tag >> 0)&0xFF) == toupper((tags->tag >> 0)&0xFF) 1675 for(i=0; tags[i].id != CODEC_ID_NONE;i++) {
1676 && toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF) 1676 if(tag == tags[i].tag)
1677 && toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF) 1677 return tags[i].id;
1678 && toupper((tag >>24)&0xFF) == toupper((tags->tag >>24)&0xFF)) 1678 }
1679 return tags->id; 1679 for(i=0; tags[i].id != CODEC_ID_NONE; i++) {
1680 tags++; 1680 if( toupper((tag >> 0)&0xFF) == toupper((tags[i].tag >> 0)&0xFF)
1681 && toupper((tag >> 8)&0xFF) == toupper((tags[i].tag >> 8)&0xFF)
1682 && toupper((tag >>16)&0xFF) == toupper((tags[i].tag >>16)&0xFF)
1683 && toupper((tag >>24)&0xFF) == toupper((tags[i].tag >>24)&0xFF))
1684 return tags[i].id;
1681 } 1685 }
1682 return CODEC_ID_NONE; 1686 return CODEC_ID_NONE;
1683 } 1687 }
1684 1688
1685 unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id) 1689 unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)