#define _MP4_FILE ".mp4"
#define _ASF_FILE ".asf"
#define MEDIA_SVC_ARTWORK_SIZE 2000
+#define MEDIA_SVC_DEFAULT_FORMAT_LEN 19
+
static int media_svc_pinyin_support = -1;
if (t.tm_isdst != 0)
media_svc_debug("DST %d", t.tm_isdst);
- modified_t = mktime(&t);
+ /* If time string has timezone */
+ if (strptime(timstr, "%Y:%m:%d %H:%M:%S %z", &t) || strptime(timstr, "%Y-%m-%d %H:%M:%S %z", &t)) {
+ GTimeVal timeval;
+ char tim_tmp_str[255] = { 0, };
+
+ /* ISO8601 Time string format */
+ strftime(tim_tmp_str, 255, "%Y-%m-%dT%H:%M:%S%z", &t);
+ g_time_val_from_iso8601(tim_tmp_str, &timeval);
+ modified_t = timeval.tv_sec;
+ media_svc_debug("Calibrated timeval : [%d][%s]", modified_t, tim_tmp_str);
+ } else {
+ /* Just localtime */
+ modified_t = mktime(&t);
+ }
+
if (modified_t > 0)
return modified_t;
else
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_RECDATE, &p, &size, NULL);
if ((mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
- if (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
+ 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. change it to 2013:01:01 00:00:00 like exif time format*/
- char *time_info = (char*)calloc(1, (size + 1));
+ 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) {
time_value++;
p_value++;
}
- *time_value = '\0';
content_info->media_meta.recorded_date = g_strdup(time_info);
SAFE_FREE(time_info);
} else {
}
if (STRING_VALID(content_info->media_meta.recorded_date)) {
- /* This is same as datetaken */
- content_info->media_meta.datetaken = g_strdup(content_info->media_meta.recorded_date);
-
content_info->timeline = __media_svc_get_timeline_from_str(content_info->media_meta.recorded_date);
if (content_info->timeline == 0)
content_info->timeline = content_info->modified_time;
else
media_svc_debug("Timeline : %ld", content_info->timeline);
+
+ /* This is same as datetaken */
+ /* Remove compensation string */
+ if (strlen(content_info->media_meta.recorded_date) > MEDIA_SVC_DEFAULT_FORMAT_LEN) {
+ content_info->media_meta.datetaken = g_strndup(content_info->media_meta.recorded_date, MEDIA_SVC_DEFAULT_FORMAT_LEN);
+ G_SAFE_FREE(content_info->media_meta.recorded_date);
+ content_info->media_meta.recorded_date = g_strdup(content_info->media_meta.datetaken);
+ } else {
+ content_info->media_meta.datetaken = g_strdup(content_info->media_meta.recorded_date);
+ }
}
} else {
SAFE_FREE(err_attr_name);