mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_RECDATE, &p, &size, NULL);
if ((mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
- char mime_type[255] = {0, };
- ret = __media_svc_get_mime_type(content_info->path, mime_type);
- /*if 3gp that audio only, media_type is music */
- if ((ret == MS_MEDIA_ERR_NONE) &&
- ((content_info->media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO && strcmp(mime_type, "video/mp4") == 0) ||
- (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO && strcmp(mime_type, "video/3gpp") == 0) ||
- (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_MUSIC && strcmp(mime_type, "video/3gpp") == 0) ||
- (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_MUSIC && strcmp(mime_type, "audio/mp4") == 0))) {
- /*Creation time format is 2013-01-01 00:00:00 +0000. change it to 2013:01:01 00:00:00 like exif time format*/
- char *time_info = g_strdup_printf("0000:00:00 00:00:00 +0000");
- char *p_value = p;
- char *time_value = time_info;
- if (time_info != NULL) {
- while (*p_value != '\0') {
- if (*p_value == '-')
- *time_value = ':';
- else
- *time_value = *p_value;
- time_value++;
- p_value++;
- }
- content_info->media_meta.recorded_date = g_strdup(time_info);
- SAFE_FREE(time_info);
- } else {
- media_svc_error("memory allocation error");
- }
+ if (g_str_has_suffix(content_info->mime_type, "mp4") || g_str_has_suffix(content_info->mime_type, "3gpp")) {
+ /*Creation time format is 2013-01-01 00:00:00 +0000. change it to 2013:01:01 00:00:00 +0000 like exif time format*/
+ char *p_value = g_strdelimit(g_strdup(p), "-", ':');
+ content_info->media_meta.recorded_date = g_strdup_printf("%s +0000", p_value);
+ SAFE_FREE(p_value);
} else {
content_info->media_meta.recorded_date = g_strdup(p);
}