diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-02-14 15:09:21 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-02-14 15:09:21 +0000 |
commit | b2b8d0e1f2a32b6e7d62038be36d7a61ea92f3c1 (patch) | |
tree | 616d33980d1e5b5500b88e72e6f552c8c32c7b87 | |
parent | 782c37899b9abf1cea45e8f8e3d65163378c5cd1 (diff) | |
download | mpv-b2b8d0e1f2a32b6e7d62038be36d7a61ea92f3c1.tar.bz2 mpv-b2b8d0e1f2a32b6e7d62038be36d7a61ea92f3c1.tar.xz |
Simplify and slightly speed up avi_stream_id function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30583 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/demuxer.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index a9fc58dea8..28c4c951f1 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -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; } |