return false;
}
-static int __media_svc_get_location_value(MMHandleType tag, double *longitude, double *latitude, double *altitude)
-{
- int mmf_error = 0;
- double gps_value = 0.0;
-
- mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_LONGITUDE, &gps_value, NULL);
- if (mmf_error == FILEINFO_ERROR_NONE) {
- if (longitude != NULL)
- *longitude = (gps_value == 0.0) ? MEDIA_SVC_DEFAULT_GPS_VALUE : gps_value;
- }
-
- mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_LATIDUE, &gps_value, NULL);
- if (mmf_error == FILEINFO_ERROR_NONE) {
- if (latitude != NULL)
- *latitude = (gps_value == 0.0) ? MEDIA_SVC_DEFAULT_GPS_VALUE : gps_value;
- }
-
- mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_ALTIDUE, &gps_value, NULL);
- if (mmf_error == FILEINFO_ERROR_NONE) {
- if (altitude != NULL)
- *altitude = (gps_value == 0.0) ? MEDIA_SVC_DEFAULT_GPS_VALUE : gps_value;
- }
-
- return MS_MEDIA_ERR_NONE;
-}
-
static int __media_svc_resize_artwork(const char *path, const char *img_format)
{
int ret = MS_MEDIA_ERR_NONE;
mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_TITLE, &p, &size, NULL);
if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
- if (!isspace(*p)) {
- content_info->media_meta.title = g_strdup(p);
- } else {
- int idx = 0;
+ while(p && isspace(*p))
+ p++;
- for (idx = 0; idx < size; idx++) {
- if (isspace(*p)) {
- media_svc_debug("SPACE [%s]", p);
- p++;
- continue;
- } else {
- media_svc_debug("Not SPACE [%s]", p);
- content_info->media_meta.title = g_strdup(p);
- break;
- }
- }
- }
+ content_info->media_meta.title = g_strdup(p);
}
mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_DESCRIPTION, &p, &size, NULL);
double latitude = 0.0;
double altitude = 0.0;
- __media_svc_get_location_value(tag, &longitude, &latitude, &altitude);
- content_info->media_meta.longitude = longitude;
- content_info->media_meta.latitude = latitude;
- content_info->media_meta.altitude = altitude;
+ mm_file_get_attrs(tag, MM_FILE_TAG_LONGITUDE, &longitude,
+ MM_FILE_TAG_LATIDUE, &latitude,
+ MM_FILE_TAG_ALTIDUE, &altitude,
+ NULL);
+
+ content_info->media_meta.longitude = (longitude == 0.0) ? MEDIA_SVC_DEFAULT_GPS_VALUE : longitude;
+ content_info->media_meta.latitude = (latitude == 0.0) ? MEDIA_SVC_DEFAULT_GPS_VALUE : latitude;
+ content_info->media_meta.altitude = (altitude == 0.0) ? MEDIA_SVC_DEFAULT_GPS_VALUE : altitude;
mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_CDIS, &cdis_value, NULL);
if (mmf_error != FILEINFO_ERROR_NONE)