{
int idx = 0;
+ media_svc_retvm_if(path == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "path is null");
+ media_svc_retvm_if(mimetype == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "mimetype is null");
+ media_svc_retvm_if(category == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "category is null");
+
*category = MEDIA_SVC_CATEGORY_UNKNOWN;
/*categorize from mimetype */
for (idx = 0; idx < CONTENT_TYPE_NUM; idx++) {
- if (strstr(mimetype, content_category[idx].content_type) != NULL) {
+ if (strncmp(mimetype, content_category[idx].content_type, strlen(content_category[idx].content_type)) == 0) {
*category = (*category | content_category[idx].category_by_mime);
break;
}
/*in application type, exitst sound file ex) x-smafs, asf */
if (*category & MEDIA_SVC_CATEGORY_ETC) {
- int prefix_len = strlen(content_category[0].content_type);
+ int prefix_len = strlen(content_category[MEDIA_SVC_CATEGORY_ETC].content_type) + 1;
char *ext = NULL;
for (idx = 0; idx < SOUND_MIME_NUM; idx++) {
/*check music file in sound files. */
if (*category & MEDIA_SVC_CATEGORY_SOUND) {
- int prefix_len = strlen(content_category[0].content_type) + 1;
+ int prefix_len = strlen(content_category[MEDIA_SVC_CATEGORY_SOUND].content_type) + 1;
for (idx = 0; idx < MUSIC_MIME_NUM; idx++) {
if (strcmp(mimetype + prefix_len, music_mime_table[idx]) == 0) {