AvFileContentInfo id3Handle;
unsigned int streamOffset;
unsigned int tagOffset;
- char isTagPresent;
unsigned int tagInfoSize;
unsigned char tagVersion;
TAacFormatType formatType;
{
/* Default Initializations */
privateData->streamOffset = 0;
- privateData->isTagPresent = FALSE;
privateData->streamOffset = 0;
privateData->tagOffset = 0;
return false;
}
- pData->isTagPresent = true;
pData->tagOffset = 0;
pData->streamOffset = pData->tagInfoSize;
filename += strlen(MMFILE_MEM_URI);
splitedString = g_strsplit(filename, ":", -1);
- mm_file_retvm_if_fails(DEBUG, splitedString, MMFILE_IO_FAILED);
+ mm_file_retvm_if_fails(DEBUG, splitedString, MMFILE_UTIL_FAIL);
if (!splitedString[0] || !splitedString[1]) {
debug_error(DEBUG, "invalid param\n");
g_strfreev(splitedString);
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
exception:
g_strfreev(splitedString);
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
static int _mmf_mem_read(void *opaque, uint8_t *buf, int size)
}
ret = _mmf_mem_open(&handle, formatContext->uriFileName);
- if (ret != MMFILE_IO_SUCCESS) {
+ if (ret != MMFILE_UTIL_SUCCESS) {
debug_warning(DEBUG, "failed to _mmf_mem_open.\n");
goto exception;
}
static bool __check_uhqa(int sample_rate, enum AVSampleFormat sample_fmt_info)
{
- bool ret = FALSE;
-
debug_error(RELEASE, "[sample rate %d, sample format %d]", sample_rate, sample_fmt_info);
if ((sample_rate >= 44100) && (sample_fmt_info >= AV_SAMPLE_FMT_S32)) {
debug_msg(RELEASE, "UHQA CONTENT");
- ret = TRUE;
- } else {
- ret = FALSE;
+ return true;
}
- return ret;
+ return false;
}
}
if (!g_ascii_strcasecmp(tag->key, "title")) {
- MMFILE_SAFE_FREE(formatContext->title);
+ mmfile_free(formatContext->title);
formatContext->title = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "artist")) {
- MMFILE_SAFE_FREE(formatContext->artist);
+ mmfile_free(formatContext->artist);
formatContext->artist = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "composer")) {
- MMFILE_SAFE_FREE(formatContext->composer);
+ mmfile_free(formatContext->composer);
formatContext->composer = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "album")) {
- MMFILE_SAFE_FREE(formatContext->album);
+ mmfile_free(formatContext->album);
formatContext->album = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "album_artist")) {
- MMFILE_SAFE_FREE(formatContext->album_artist);
+ mmfile_free(formatContext->album_artist);
formatContext->album_artist = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "copyright")) {
- MMFILE_SAFE_FREE(formatContext->copyright);
+ mmfile_free(formatContext->copyright);
formatContext->copyright = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "comment")) {
- MMFILE_SAFE_FREE(formatContext->comment);
+ mmfile_free(formatContext->comment);
formatContext->comment = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "description")) {
- MMFILE_SAFE_FREE(formatContext->description);
+ mmfile_free(formatContext->description);
formatContext->description = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "genre")) {
- MMFILE_SAFE_FREE(formatContext->genre);
+ mmfile_free(formatContext->genre);
formatContext->genre = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "date")) {
- MMFILE_SAFE_FREE(formatContext->year);
+ mmfile_free(formatContext->year);
formatContext->year = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "creation_time")) {
- MMFILE_SAFE_FREE(formatContext->recDate);
+ mmfile_free(formatContext->recDate);
formatContext->recDate = g_strdup(tag->value);
} else if ((!g_ascii_strcasecmp(tag->key, "track")) || (!g_ascii_strcasecmp(tag->key, "tracknumber"))) {
- MMFILE_SAFE_FREE(formatContext->tagTrackNum);
+ mmfile_free(formatContext->tagTrackNum);
formatContext->tagTrackNum = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "lyrics")) {
- MMFILE_SAFE_FREE(formatContext->unsyncLyrics);
+ mmfile_free(formatContext->unsyncLyrics);
formatContext->unsyncLyrics = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "rotate")) { /*can be "90", "180", "270" */
- MMFILE_SAFE_FREE(formatContext->rotate);
+ mmfile_free(formatContext->rotate);
formatContext->rotate = g_strdup(tag->value);
} else if (!g_ascii_strcasecmp(tag->key, "spherical-video")) {
ParseSpatialVideoMetadataFromXMLString(tag->value, formatContext);
filename += strlen(MMFILE_MEM_URI);
splitedString = g_strsplit(filename, ":", -1);
- mm_file_retvm_if_fails(DEBUG, splitedString, MMFILE_IO_FAILED);
+ mm_file_retvm_if_fails(DEBUG, splitedString, MMFILE_UTIL_FAIL);
if (!splitedString[0] || !splitedString[1]) {
debug_error(DEBUG, "invalid param\n");
g_strfreev(splitedString);
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
exception:
g_strfreev(splitedString);
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
static int _mmf_mem_read(void *opaque, uint8_t *buf, int size)
ret = mmfile_open(&fp, urifilename, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
mmfile_close(fp);
return MMFILE_FORMAT_FAIL;
}
ret = _mmf_mem_open(&handle, urifilename);
- if (ret != MMFILE_IO_SUCCESS) {
+ if (ret != MMFILE_UTIL_SUCCESS) {
debug_warning(DEBUG, "failed to _mmf_mem_open.\n");
av_free(avio_ctx_buffer);
ret = MMFILE_FORMAT_FAIL;
ret = mmfile_open(&fp, *urifilename, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto FILE_FORMAT_FAIL;
}
ret = mmfile_open(&fp, *urifilename, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto FILE_FORMAT_FAIL;
}
if (formatContext->streams[MMFILE_AUDIO_STREAM] != NULL)
parse->is_uhqa = formatContext->streams[MMFILE_AUDIO_STREAM]->is_uhqa;
else
- parse->is_uhqa = FALSE;
+ parse->is_uhqa = false;
if (parse->type >= MM_FILE_PARSE_TYPE_ALL && formatContext->videoTotalTrackNum > 0) {
/*why below code needed?
*is_uhqa = parse.is_uhqa;
} else {
debug_error(DEBUG, "_get_contents_info failed\n");
- *is_uhqa = FALSE;
+ *is_uhqa = false;
}
mm_attrs_free(attrs);
int _frame_size = 0;
int width = 0;
int height = 0;
- bool is_accurate = FALSE;
+ bool is_accurate = false;
unsigned long long time_stamp = 5 * 1000 * 1000; //5sec
memset(filename, 0x00, sizeof(filename));
if (strlen(accurate_mode) > 0) {
if (strncmp(accurate_mode, "1", 1) == 0)
- is_accurate = TRUE;
+ is_accurate = true;
}
printf("Extracting video frame for [%s] [%llu] accurate [%d]\n", filename, time_stamp, is_accurate);
- if (file_test == TRUE)
+ if (file_test == true)
ret = mm_file_get_video_frame(filename, time_stamp, is_accurate, (unsigned char **)&_frame, &_frame_size, &width, &height);
else {
unsigned int file_size = 0;
#define MMFILE_UTIL_FAIL -1
#define MMFILE_UTIL_SUCCESS 0
-#define MMFILE_IO_FAILED MMFILE_UTIL_FAIL
-#define MMFILE_IO_SUCCESS MMFILE_UTIL_SUCCESS
-#define CAST_MM_HANDLE(x) (MMHandleType)(x)
-
-#define MMFILE_SAFE_FREE(src) {if (src) {free(src); src = NULL; } }
-
-#ifndef TRUE
-#define TRUE (1 == 1)
-#endif
-#ifndef FALSE
-#define FALSE (!TRUE)
-#endif
-
#define MM_FILE_INI_PATH "/etc/multimedia/mm_file_config.ini"
char *MMFileUtilGetLocale();
-
-
-/*////////////////////////////////////////////////////////////////////// */
-/* IMAGE API // */
-/*////////////////////////////////////////////////////////////////////// */
-typedef enum {
- MMFILE_PIXEL_FORMAT_YUV420 = 0,
- MMFILE_PIXEL_FORMAT_YUV422 = 1,
- MMFILE_PIXEL_FORMAT_RGB565 = 2,
- MMFILE_PIXEL_FORMAT_RGB888 = 3,
- MMFILE_PIXEL_FORMAT_MAX,
-} eMMFilePixelFormat;
-
-int mmfile_util_image_convert(unsigned char *src, eMMFilePixelFormat src_fmt, int src_width, int src_height, unsigned char *dst, eMMFilePixelFormat dst_fmt, int dst_width, int dst_height);
-
-
#ifdef __MMFILE_MEM_TRACE__
/*////////////////////////////////////////////////////////////////////// */
/* MEMORY DEBUG API // */
/* TAG API // */
/*////////////////////////////////////////////////////////////////////// */
-#define MM_FILE_REVERSE_BYTE_ORDER_INT(i) ((int)((((i)&0xFF000000)>>24) | (((i)&0x00FF0000)>>8) | (((i)&0x0000FF00)<<8) | (((i)&0x000000FF)<<24)))
-#define MM_FILE_REVERSE_BYTE_ORDER_SHORT(s) ((short)((((s)&0xFF00)>>8) | (((s)&0x00FF)<<8)))
-
-#define _STRNCPY_EX(dst, src, size) { if ((size > 0)) {strncpy((char*)(dst), (char*)(src), (size)); *((dst) + (size)) = '\0'; } }
-
inline static int __AvMemstr(unsigned char *mem, unsigned char *str, int str_len, int search_range)
{
int offset = 0;
#define MP3_TAGv2_22_TXT_HEADER_LEN 6
#define TAGV1_SEEK_GAP 10
-
-typedef enum {
- AV_ID3V2_PICTURE_TYPE_MIN,
- AV_ID3V2_PICTURE_TYPE_OTHER = AV_ID3V2_PICTURE_TYPE_MIN,
- AV_ID3V2_PICTURE_TYPE_PNG_ONLY_FILEICON,
- AV_ID3V2_PICTURE_TYPE_OTHER_FILEICON,
- AV_ID3V2_PICTURE_TYPE_FRONT_COVER,
- AV_ID3V2_PICTURE_TYPE_BACK_COVER,
- AV_ID3V2_PICTURE_TYPE_LEAFLET_PAGE,
- AV_ID3V2_PICTURE_TYPE_MEDIA_SIDEOFCD,
- AV_ID3V2_PICTURE_TYPE_LEAD_ARTIST,
- AV_ID3V2_PICTURE_TYPE_ARTIST_PERFORMER,
- AV_ID3V2_PICTURE_TYPE_CONDUCTOR,
- AV_ID3V2_PICTURE_TYPE_BAND_ORCHESTRA,
- AV_ID3V2_PICTURE_TYPE_COMPOSER,
- AV_ID3V2_PICTURE_TYPE_LYRICIST_TEXTWRITER,
- AV_ID3V2_PICTURE_TYPE_RECORDING_LOCATION,
- AV_ID3V2_PICTURE_TYPE_DURING_RECORDING,
- AV_ID3V2_PICTURE_TYPE_DURING_PERFORMANCE,
- AV_ID3V2_PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE,
- AV_ID3V2_PICTURE_TYPE_BRIGHT_COLOURED_FISH,
- AV_ID3V2_PICTURE_TYPE_ILLUSTRATION,
- AV_ID3V2_PICTURE_TYPE_BAND_ARTIST_LOGOTYPE,
- AV_ID3V2_PICTURE_TYPE_PUBLISHER_STUDIO_LOGOTYPE,
-
- AV_ID3V2_PICTURE_TYPE_MAX,
- AV_ID3V2_PICTURE_TYPE_UNKNOWN = AV_ID3V2_PICTURE_TYPE_MAX /* Unknown picture type */
-
-} AvID3v2PictureType;
-
+/**
+ $00 Other
+ $01 32x32 pixels 'file icon' (PNG only)
+ $02 Other file icon
+ $03 Cover (front)
+ $04 Cover (back)
+ $05 Leaflet page
+ $06 Media (e.g. lable side of CD)
+ $07 Lead artist/lead performer/soloist
+ $08 Artist/performer
+ $09 Conductor
+ $0A Band/Orchestra
+ $0B Composer
+ $0C Lyricist/text writer
+ $0D Recording Location
+ $0E During recording
+ $0F During performance
+ $10 Movie/video screen capture
+ $11 A bright coloured fish
+ $12 Illustration
+ $13 Band/artist logotype
+ $14 Publisher/Studio logotype
+*/
+#define MP3_ID3V2_PICTURE_TYPE_MAX 0x15
#define MP3TAGINFO_SIZE 128 /* file end 128 byte */
#define MP3_ID3_TITLE_LENGTH 30
#define MP3_ID3_IMAGE_DESCRIPTION_MAX_LENGTH 65
#define MP3_ID3_IMAGE_MIME_TYPE_MAX_LENGTH 31
#define MP3_ID3_IMAGE_EXT_MAX_LENGTH 4
-#define TCC_FM_PATH_MOUNT_MMC "/Mount/Mmc"
-
typedef enum {
} AvFileContentInfo;
typedef struct {
- int videocodec;
- int audiocodec;
- int width;
- int height;
-} AvExtraInfo;
-
-typedef struct {
unsigned long time_info;
char *lyric_info;
} AvSynclyricsInfo;
if (!handle || !Func || !filename || !Func->mmfile_open) {
debug_error(DEBUG, "invalid param\n");
- err = MMFILE_IO_FAILED;
+ err = MMFILE_UTIL_FAIL;
goto fail;
}
err = Func->mmfile_open(pHandle, filename, flags);
if (err < 0) {
debug_error(DEBUG, "mmfile_open: pHandle->fileName\n");
- err = MMFILE_IO_FAILED;
+ err = MMFILE_UTIL_FAIL;
goto fail;
}
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
fail:
if (handle && *handle) { /* fix for prevent */
if (!handle || !filename) {
debug_error(DEBUG, "invalid param\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
memset(handle_str, 0x00, sizeof(handle_str));
*handle = NULL;
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
{
int ret = 0;
if (!handle) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
if (!handle->iofunc || !handle->iofunc->mmfile_read) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
ret = handle->iofunc->mmfile_read(handle, buf, size);
{
int ret = 0;
if (!handle) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
if (!handle->iofunc || !handle->iofunc->mmfile_write) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
ret = handle->iofunc->mmfile_write(handle, buf, size);
{
long long ret = 0;
if (!handle || !handle->iofunc || !handle->iofunc->mmfile_seek) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
ret = handle->iofunc->mmfile_seek(handle, pos, whence);
{
long long ret = 0;
if (!handle || !handle->iofunc || !handle->iofunc->mmfile_tell) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
ret = handle->iofunc->mmfile_tell(handle);
cur_pos = mmfile_tell(handle);
if (cur_pos < 0)
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
if (mmfile_seek(handle, 0L, MMFILE_SEEK_SET) < 0)
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
if (mmfile_seek(handle, 0L, MMFILE_SEEK_END) < 0)
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
filesize = mmfile_tell(handle);
int ret = 0;
if (!handle || !handle->iofunc || !handle->iofunc->mmfile_close) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
ret = handle->iofunc->mmfile_close(handle);
MMFileIOFunc **ptr = NULL;
if (!iofunc) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
ptr = &first_io_func;
*ptr = iofunc;
iofunc->next = NULL;
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
}
static int initialized = 0;
if (initialized) {
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
is_little_endian = _is_little_endian();
mmfile_register_io_func(&mmfile_mem_io_handler);
mmfile_register_io_func(&mmfile_mmap_io_handler);
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
}
if (!handle || !filename) {
debug_error(DEBUG, "invalid param\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
filename += strlen(handle->iofunc->handleName) + 3; /* :// */
fd = open(filename, access);
if (fd < 0) {
debug_error(DEBUG, "open error\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
privateData = g_new0(tMMFORMAT_FILEIO_DATA, 1);
privateData->offset = 0;
handle->privateData = (void *)privateData;
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
}
static int file_read(MMFileIOHandle *handle, unsigned char *buf, int size)
readSize = read(privateData->fd, buf, size);
if (readSize < 0) {
debug_error(RELEASE, "read\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
privateData->offset += readSize;
writtenSize = write(privateData->fd, buf, size);
if (writtenSize < 0) {
debug_error(RELEASE, "write\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
privateData->offset += writtenSize;
close(privateData->fd);
mmfile_free(privateData);
handle->privateData = NULL;
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
}
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
if (!handle || !filename || !handle->iofunc || !handle->iofunc->handleName) {
debug_error(DEBUG, "invalid param\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
filename += strlen(handle->iofunc->handleName) + 3; /* ://%d:%d means (memory addr:mem size)*/
splitedString = g_strsplit(filename, ":", -1);
- mm_file_retvm_if_fails(DEBUG, splitedString, MMFILE_IO_FAILED);
+ mm_file_retvm_if_fails(DEBUG, splitedString, MMFILE_UTIL_FAIL);
if (!splitedString[0] || !splitedString[1]) {
debug_error(DEBUG, "invalid param\n");
g_strfreev(splitedString);
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
exception:
g_strfreev(splitedString);
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
static int mmf_mem_read(MMFileIOHandle *h, unsigned char *buf, int size)
if (!h || !h->privateData || !buf || size <= 0) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
memHandle = h->privateData;
if (!memHandle->ptr) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
c = memHandle->ptr + memHandle->offset;
if (!h || !h->privateData || !buf) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
memHandle = h->privateData;
if (!h || !h->privateData) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
memHandle = h->privateData;
tmp_offset = memHandle->size + pos;
break;
default:
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
/*check validation*/
if (tmp_offset < 0) {
debug_error(DEBUG, "invalid file offset\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
/*set */
if (!h || !h->privateData) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
memHandle = h->privateData;
if (!h || !h->privateData) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
memHandle = h->privateData;
h->privateData = NULL;
}
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
}
if (!handle || !filename || !handle->iofunc || !handle->iofunc->handleName) {
debug_error(DEBUG, "invalid param\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
filename += strlen(handle->iofunc->handleName) + 3; /* :// */
handle->privateData = (void *) mmapHandle;
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
exception:
if (mmapHandle) {
handle->privateData = NULL;
}
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
static int mmf_mmap_read(MMFileIOHandle *h, unsigned char *buf, int size)
if (!h || !h->privateData || !buf || size <= 0) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
mmapHandle = h->privateData;
if (!h || !h->privateData || !buf) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
mmapHandle = h->privateData;
if (!h || !h->privateData) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
mmapHandle = h->privateData;
tmp_offset = mmapHandle->size + pos;
break;
default:
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
/*check validation*/
if (tmp_offset < 0) {
debug_error(DEBUG, "invalid file offset\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
/*set */
if (!h || !h->privateData) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
mmapHandle = h->privateData;
if (!h || !h->privateData) {
debug_error(DEBUG, "invalid para\n");
- return MMFILE_IO_FAILED;
+ return MMFILE_UTIL_FAIL;
}
mmapHandle = h->privateData;
h->privateData = NULL;
- return MMFILE_IO_SUCCESS;
+ return MMFILE_UTIL_SUCCESS;
}
return NULL;
}
- ucsdet_enableInputFilter(ucsd, TRUE);
+ ucsdet_enableInputFilter(ucsd, true);
ucsdet_setText(ucsd, str, strlen(str), &status);
if (U_FAILURE(status)) {
if (end == buffer) {
debug_error(RELEASE, "not a decimal number");
- return FALSE;
+ return false;
} else if ('\0' != *end) {
debug_error(RELEASE, "extra characters at end of input: %s", end);
- return FALSE;
+ return false;
} else if ((LONG_MIN == sl || LONG_MAX == sl) && (ERANGE == errno)) {
debug_error(RELEASE, "out of range of type long");
- return FALSE;
+ return false;
} else if (sl > INT_MAX) {
debug_error(RELEASE, "greater than INT_MAX");
- return FALSE;
+ return false;
} else if (sl < INT_MIN) {
debug_error(RELEASE, "less than INT_MIN");
- return FALSE;
+ return false;
} else {
*si = (int)sl;
}
- return TRUE;
+ return true;
}
static bool make_characterset_array(char ***charset_array)
{
/* get the picture type of Attached PICture, it is 1byte(0xff) */
- if (pTagVal[*offset] < AV_ID3V2_PICTURE_TYPE_MAX)
+ if (pTagVal[*offset] < MP3_ID3V2_PICTURE_TYPE_MAX)
pInfo->imageInfo.pictureType = pTagVal[*offset];
else
debug_msg(RELEASE, "APIC image has invalid picture type(0x%x)\n", pTagVal[*offset]);
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
ret = 0;
goto exit;
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
const char * probe_data[2] = { "matroska", "webm" };
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}
if (fp == NULL) {
ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
- if (ret == MMFILE_IO_FAILED) {
+ if (ret == MMFILE_UTIL_FAIL) {
debug_error(DEBUG, "error: mmfile_open\n");
goto exit;
}