Factorize some code into the new function ff_toupper4().

Patch by Francesco Lavra, francescolavra interfree it

Originally committed as revision 23158 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Francesco Lavra
2010-05-18 19:16:40 +00:00
committed by Carl Eugen Hoyos
parent b74f67eb17
commit 603a5f04b2
4 changed files with 15 additions and 12 deletions

View File

@ -20,6 +20,7 @@
*/
#include "avformat.h"
#include "internal.h"
#include "libavcodec/internal.h"
#include "libavcodec/opt.h"
#include "metadata.h"
#include "libavutil/avstring.h"
@ -2041,10 +2042,7 @@ enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
return tags[i].id;
}
for(i=0; tags[i].id != CODEC_ID_NONE; i++) {
if( toupper((tag >> 0)&0xFF) == toupper((tags[i].tag >> 0)&0xFF)
&& toupper((tag >> 8)&0xFF) == toupper((tags[i].tag >> 8)&0xFF)
&& toupper((tag >>16)&0xFF) == toupper((tags[i].tag >>16)&0xFF)
&& toupper((tag >>24)&0xFF) == toupper((tags[i].tag >>24)&0xFF))
if (ff_toupper4(tag) == ff_toupper4(tags[i].tag))
return tags[i].id;
}
return CODEC_ID_NONE;