/***********************************************************************/
static int _MMFileSearchID3Tag(MMFileIOHandle *fp, unsigned int *offset);
static int _MMFileIsMP3Header(void *header);
-static int _MMFileIsOGGHeader(void *header);
-static int _MMFileIsREALHeader(void *header);
static int _MMFileIsMP4Header(void *header);
-static int _MMFileIsWAVHeader(void *header);
-static int _MMFileIsAVIHeader(void *header);
static int _MMFileIsMIDHeader(void *header);
static int _MMFileIsMMFHeader(void *header);
-static int _MMFileIsIMYHeader(void *header);
static int _MMFileIsASFHeader(void *header);
static int _MMFileIsAMRHeader(void *header);
-static int _MMFileIsFLACHeader(void *header);
-static int _MMFileIsFLVHeader(void *header);
static int _MMFileIsMPEGTSHeader(MMFileIOHandle *fp);
static int _MMFileIsMPEGPSHeader(void *header);
static int _MMFileIsMPEGAUDIOHeader(void *header);
static int _MMFileIsMPEGVIDEOHeader(void *header);
-static int _MMFileIsAIFFHeader(void *header);
-static int _MMFileIsAPEHeader(void *header);
/***********************************************************************/
/* MP3 Header Check API */
}
for (j = 0; (j <= readed - _MMFILE_OGG_HEADER_LENGTH); j++) {
- if (1 == _MMFileIsOGGHeader(buffer + j)) {
+ if (!memcmp(buffer + j, "OggS", 4)) {
ret = 1;
debug_msg(RELEASE, "Header Detected at %d\n", i + j);
goto exit;
goto exit;
}
- if (1 == _MMFileIsWAVHeader(buffer)) {
+ if (!memcmp(buffer, "RIFF", 4) && !memcmp(buffer + 8, "WAVE", 4)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
goto exit;
}
- if (1 == _MMFileIsAVIHeader(buffer)) {
+ if (!memcmp(buffer, "RIFF", 4) && !memcmp(buffer + 8, "AVI", 3)) {
debug_msg(RELEASE, "Header Detected \n");
ret = 1;
goto exit;
goto exit;
}
- if (1 == _MMFileIsIMYHeader(buffer)) {
+ if (!memcmp(buffer, "BEGIN:IMELODY", 13)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
goto exit;
}
- if (1 == _MMFileIsFLACHeader(buffer)) {
+ if (!memcmp(buffer, "fLaC", 4)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
goto exit;
}
- if (1 == _MMFileIsFLVHeader(buffer)) {
+ if (!memcmp(buffer, "FLV", 3)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
goto exit;
}
- if (1 == _MMFileIsREALHeader(buffer)) {
+ if (!memcmp(buffer, ".RMF", 4)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
}
- if (1 == _MMFileIsAIFFHeader(buffer)) {
+ if (!memcmp(buffer, "FORM", 4) && !memcmp(buffer + 8, "AIFF", 4)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
goto exit;
}
- if (1 == _MMFileIsAPEHeader(buffer)) {
+ if (!memcmp(buffer, "MAC ", 4)) {
debug_msg(RELEASE, "Header Detected\n");
ret = 1;
goto exit;
static int _MMFileIsAMRHeader(void *header)
{
-#define _MMFILE_AMR_SINGLE_CH_HEADER_SIZE 6
-#define _MMFILE_AMR_SINGLE_CH_HEADER "#!AMR\n"
-
-#define _MMFILE_AMR_WB_SINGLE_CH_HEADER_SIZE 9
-#define _MMFILE_AMR_WB_SINGLE_CH_HEADER "#!AMR-WB\n"
-
-#define _MMFILE_AMR_MULTI_CH_HEADER_SIZE 12
-#define _MMFILE_AMR_MULTI_CH_HEADER "#!AMR_MC1.0\n"
-
-#define _MMFILE_AMR_WB_MULTI_CH_HEADER_SIZE 15
-#define _MMFILE_AMR_WB_MULTI_CH_HEADER "#!AMR-WB_MC1.0\n"
-
unsigned char *s = header;
- if (!memcmp(s, _MMFILE_AMR_SINGLE_CH_HEADER, _MMFILE_AMR_SINGLE_CH_HEADER_SIZE) ||
- !memcmp(s, _MMFILE_AMR_WB_SINGLE_CH_HEADER, _MMFILE_AMR_WB_SINGLE_CH_HEADER_SIZE) ||
- !memcmp(s, _MMFILE_AMR_MULTI_CH_HEADER, _MMFILE_AMR_MULTI_CH_HEADER_SIZE) ||
- !memcmp(s, _MMFILE_AMR_WB_MULTI_CH_HEADER, _MMFILE_AMR_WB_MULTI_CH_HEADER_SIZE)) {
-
- return 1;
- }
-
- return 0;
-}
-
-static int _MMFileIsIMYHeader(void *header)
-{
- unsigned char *s = header;
+ if (!memcmp(s, "#!AMR\n", 6) ||
+ !memcmp(s, "#!AMR-WB\n", 9) ||
+ !memcmp(s, "#!AMR_MC1.0\n", 12) ||
+ !memcmp(s, "#!AMR-WB_MC1.0\n", 15)) {
- if (!memcmp(s, "BEGIN:IMELODY", 13)) {
return 1;
}
return 0;
}
-
-static int _MMFileIsAVIHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "RIFF", 4) && !memcmp(s + 8, "AVI", 3)) {
- return 1;
- }
-
- return 0;
-}
-
-
-static int _MMFileIsWAVHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "RIFF", 4) && !memcmp(s + 8, "WAVE", 4)) {
- return 1;
- }
-
- return 0;
-}
-
-
-
static int _MMFileIsMP4Header(void *header)
{
unsigned char *s = header;
return 0;
}
-static int _MMFileIsOGGHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "OggS", 4)) {
- return 1;
- }
-
- return 0;
-}
-
-static int _MMFileIsREALHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, ".RMF", 4)) {
- return 1;
- }
-
- return 0;
-}
-
static int _MMFileIsMPEGTSHeader(MMFileIOHandle *fp)
{
unsigned char header[TS_MAX_PACKET_SIZE] = {0, };
search_end:
return ret;
}
-
-static int _MMFileIsFLACHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "fLaC", 4)) {
- return 1;
- }
-
- return 0;
-}
-
-static int _MMFileIsFLVHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "FLV", 3)) {
- return 1;
- }
-
- return 0;
-}
-
-static int _MMFileIsAIFFHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "FORM", 4) && !memcmp(s + 8, "AIFF", 4)) {
- return 1;
- }
-
- return 0;
-}
-static int _MMFileIsAPEHeader(void *header)
-{
- unsigned char *s = header;
-
- if (!memcmp(s, "MAC ", 4)) {
- return 1;
- }
-
- return 0;
-}