diff options
author | Hyunjun Ko <zzoon.ko@samsung.com> | 2013-04-23 18:30:35 +0900 |
---|---|---|
committer | Hyunjun Ko <zzoon.ko@samsung.com> | 2013-04-23 18:30:35 +0900 |
commit | 69857e15ab13cb9c7b591cdc42535f156c65678b (patch) | |
tree | 123fded89444db6ec6e335217eab3da415299279 | |
parent | 11e4221fa9b6ecaa00897bd8159ef281426a87e4 (diff) | |
download | libmedia-service-69857e15ab13cb9c7b591cdc42535f156c65678b.tar.gz libmedia-service-69857e15ab13cb9c7b591cdc42535f156c65678b.tar.bz2 libmedia-service-69857e15ab13cb9c7b591cdc42535f156c65678b.zip |
Fix a bug in media_svc_refresh_item
-rwxr-xr-x | packaging/libmedia-service.spec | 2 | ||||
-rwxr-xr-x | src/common/media-svc.c | 22 |
2 files changed, 16 insertions, 8 deletions
diff --git a/packaging/libmedia-service.spec b/packaging/libmedia-service.spec index 90be399..4673f8a 100755 --- a/packaging/libmedia-service.spec +++ b/packaging/libmedia-service.spec @@ -1,6 +1,6 @@ Name: libmedia-service Summary: Media information service library for multimedia applications. -Version: 0.2.40 +Version: 0.2.41 Release: 1 Group: System/Libraries License: Apache License, Version 2.0 diff --git a/src/common/media-svc.c b/src/common/media-svc.c index afa5a61..f211f1c 100755 --- a/src/common/media-svc.c +++ b/src/common/media-svc.c @@ -897,14 +897,27 @@ int media_svc_refresh_item(MediaSvcHandle *handle, media_svc_storage_type_e stor ret = _media_svc_update_thumbnail_path(handle, path, NULL); media_svc_retv_if(ret != MEDIA_INFO_ERROR_NONE, ret); + /* Get notification info */ + media_svc_noti_item *noti_item = NULL; + ret = _media_svc_get_noti_info(handle, path, MS_MEDIA_ITEM_FILE, ¬i_item); + media_svc_retv_if(ret != MEDIA_INFO_ERROR_NONE, ret); + + media_type = noti_item->media_type; + if(media_type == MEDIA_SVC_MEDIA_TYPE_OTHER) { /*Do nothing.*/ } else if(media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE) { ret = _media_svc_extract_image_metadata(&content_info, media_type); - media_svc_retv_if(ret != MEDIA_INFO_ERROR_NONE, ret); + if (ret != MEDIA_INFO_ERROR_NONE) { + _media_svc_destroy_noti_item(noti_item); + return ret; + } } else { ret = _media_svc_extract_media_metadata(handle, &content_info, media_type, drm_contentInfo); - media_svc_retv_if(ret != MEDIA_INFO_ERROR_NONE, ret); + if (ret != MEDIA_INFO_ERROR_NONE) { + _media_svc_destroy_noti_item(noti_item); + return ret; + } } #if 1 /* Extracting thumbnail */ @@ -931,11 +944,6 @@ int media_svc_refresh_item(MediaSvcHandle *handle, media_svc_storage_type_e stor content_info.media_meta.height = height; } #endif - /* Get notification info */ - media_svc_noti_item *noti_item = NULL; - ret = _media_svc_get_noti_info(handle, path, MS_MEDIA_ITEM_FILE, ¬i_item); - media_svc_retv_if(ret != MEDIA_INFO_ERROR_NONE, ret); - ret = _media_svc_update_item_with_data(db_handle, &content_info); if (ret == MEDIA_INFO_ERROR_NONE) { |