/*
* To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
- *
+ *
* Copyright [2012] [JongDong Lee <jongdong.lee@samsung.com>, ChangSun Lee <cs78.lee@samsung.com>]
- *
+ *
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.tizenopensource.org/license
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
VideoLogInfo("");
- int nSortType = MP_MEDIA_SORT_BY_NAME_ASC;
filter_h m_FilterHandle = NULL;
media_content_order_e nOrderType = MEDIA_CONTENT_ORDER_ASC;
char szOrderObj[STR_LEN_MAX] = {0};
nTotalVideoTypeFiles = 0;
nNumberOfVideoItemByType = 0;
- switch(nSortType)
- {
- case MP_MEDIA_SORT_BY_NONE:
- case MP_MEDIA_SORT_BY_NAME_ASC:
- nOrderType = MEDIA_CONTENT_ORDER_ASC;
- strncpy(szOrderObj, MEDIA_TITLE, STR_LEN_MAX - 1);
- break;
-
- case MP_MEDIA_SORT_BY_NAME_DESC:
- nOrderType = MEDIA_CONTENT_ORDER_DESC;
- strncpy(szOrderObj, MEDIA_TITLE, STR_LEN_MAX - 1);
- break;
-
- case MP_MEDIA_SORT_BY_DATE_MOST_RECENT:
- nOrderType = MEDIA_CONTENT_ORDER_DESC;
- strncpy(szOrderObj, MEDIA_YEAR, STR_LEN_MAX - 1);
- break;
-
- case MP_MEDIA_SORT_BY_OLDEST:
- nOrderType = MEDIA_CONTENT_ORDER_ASC;
- strncpy(szOrderObj, MEDIA_YEAR, STR_LEN_MAX - 1);
- break;
-
- default:
- nOrderType = MEDIA_CONTENT_ORDER_ASC;
- strncpy(szOrderObj, MEDIA_TITLE, STR_LEN_MAX - 1);
- }
+ nOrderType = MEDIA_CONTENT_ORDER_ASC;
+ strncpy(szOrderObj, MEDIA_TITLE, STR_LEN_MAX - 1);
if(media_filter_create(&m_FilterHandle) != MEDIA_CONTENT_ERROR_NONE)
{
/*
* To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
- *
+ *
* Copyright [2012] [JongDong Lee <jongdong.lee@samsung.com>, ChangSun Lee <cs78.lee@samsung.com>]
- *
+ *
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.tizenopensource.org/license
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
unsigned int mp_read_xml_file(const char *file_name, char **data)
{
- unsigned int file_size = 0;
+ long file_size = 0;
FILE *fp = fopen(file_name, "r");
if (!fp) {
VideoLogInfo("file open failed!");
fseek(fp, 0, SEEK_END); /* move to end */
file_size = ftell(fp);
+ if(file_size <= 0)
+ {
+ VideoLogError("invalid file size: %d", file_size);
+ fclose(fp);
+ return 0;
+ }
+
VideoLogInfo("file_size of xml = %d", file_size);
fseek(fp, 0, SEEK_SET); /* move to start */
VideoLogInfo("nReadCounter : %d", nReadCounter);
fclose(fp);
- return file_size;
+ return (unsigned int)file_size;
+
}
/* 3: http | video/mp4 | H.264 / AVC / MPEG4 AAC / 44100 |