From 360bb11537ce9297bf96ca3aa370b7b692d8c00b Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 14 Feb 2002 23:41:00 +0000 Subject: [PATCH] fast header checker added git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4711 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/mp3_hdr.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 libmpdemux/mp3_hdr.h diff --git a/libmpdemux/mp3_hdr.h b/libmpdemux/mp3_hdr.h new file mode 100644 index 0000000000..9635760a95 --- /dev/null +++ b/libmpdemux/mp3_hdr.h @@ -0,0 +1,9 @@ + +int mp_decode_mp3_header(unsigned char* hbuf); + +static inline int mp_check_mp3_header(unsigned int head){ + if( (head & 0x0000e0ff) != 0x0000e0ff || + (head & 0x00fc0000) == 0x00fc0000) return 0; + if(mp_decode_mp3_header((unsigned char*)(&head))<=0) return 0; + return 1; +}