Simplify and slightly speed up avi_stream_id function.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30583 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-02-14 15:09:21 +00:00
parent 782c37899b
commit b2b8d0e1f2
1 changed files with 2 additions and 6 deletions

View File

@ -389,13 +389,9 @@ void ds_clear_parser(demux_stream_t *sh);
stream_t* new_ds_stream(demux_stream_t *ds);
static inline int avi_stream_id(unsigned int id){
unsigned char *p=(unsigned char *)&id;
unsigned char a,b;
#if HAVE_BIGENDIAN
a=p[3]-'0'; b=p[2]-'0';
#else
a=p[0]-'0'; b=p[1]-'0';
#endif
a = id - '0';
b = (id >> 8) - '0';
if(a>9 || b>9) return 100; // invalid ID
return a*10+b;
}