Remove unreachable code 82/138082/2
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 11 Jul 2017 04:42:46 +0000 (13:42 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 11 Jul 2017 05:05:51 +0000 (14:05 +0900)
Always width, height are greater than 0

Change-Id: I63e612ff8340452b9d9ef4ff16bbd9ade995c273
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-svc-media.c
src/common/media-svc-util.c
src/common/media-svc.c
src/include/common/media-svc-util.h

index c817bc8..08d95f5 100755 (executable)
@@ -206,21 +206,13 @@ int _media_svc_insert_item_with_data(sqlite3 *handle, const char *storage_id, me
 
                /* Get thumbnail for burst shot */
                char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
-               int width = 0;
-               int height = 0;
 
-               ret = _media_svc_request_thumbnail_with_origin_size(content_info->path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+               ret = _media_svc_request_thumbnail(content_info->path, thumb_path, sizeof(thumb_path), uid);
                if (ret == MS_MEDIA_ERR_NONE) {
                        ret = __media_svc_malloc_and_strncpy(&(content_info->thumbnail_path), thumb_path);
                        if (ret != MS_MEDIA_ERR_NONE)
                                content_info->thumbnail_path = NULL;
                }
-
-               if (content_info->media_meta.width <= 0)
-                       content_info->media_meta.width = width;
-
-               if (content_info->media_meta.height <= 0)
-                       content_info->media_meta.height = height;
        }
 
        /*Update Pinyin If Support Pinyin*/
index b10d8f6..5bd98b6 100755 (executable)
@@ -2213,12 +2213,11 @@ bool _media_svc_is_drm_file(const char *path)
        return FALSE;
 }
 
-int _media_svc_request_thumbnail_with_origin_size(const char *path, char *thumb_path, int max_length, int *origin_width, int *origin_height, uid_t uid)
+int _media_svc_request_thumbnail(const char *path, char *thumb_path, int max_length, uid_t uid)
 {
        int ret = MS_MEDIA_ERR_NONE;
 
-       ret = thumbnail_request_from_db_with_size(path, thumb_path, max_length, origin_width, origin_height, uid);
-
+       ret = thumbnail_request_from_db(path, thumb_path, max_length, uid);
        if (ret != MS_MEDIA_ERR_NONE) {
                media_svc_error("thumbnail_request_from_db failed: %d", ret);
                ret = MS_MEDIA_ERR_INTERNAL;
index 684dc84..b62909c 100755 (executable)
@@ -466,18 +466,10 @@ int media_svc_insert_item_immediately(MediaSvcHandle *handle, const char *storag
        if (content_info.thumbnail_path == NULL) {
                if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
                        char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
-                       int width = 0;
-                       int height = 0;
 
-                       ret = _media_svc_request_thumbnail_with_origin_size(content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+                       ret = _media_svc_request_thumbnail(content_info.path, thumb_path, sizeof(thumb_path), uid);
                        if (ret == MS_MEDIA_ERR_NONE)
                                ret = __media_svc_malloc_and_strncpy(&(content_info.thumbnail_path), thumb_path);
-
-                       if (content_info.media_meta.width <= 0)
-                               content_info.media_meta.width = width;
-
-                       if (content_info.media_meta.height <= 0)
-                               content_info.media_meta.height = height;
                }
        }
 
@@ -932,18 +924,10 @@ int media_svc_refresh_item(MediaSvcHandle *handle, const char *storage_id, media
        if (content_info.thumbnail_path == NULL) {
                if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
                        char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
-                       int width = 0;
-                       int height = 0;
 
-                       ret = _media_svc_request_thumbnail_with_origin_size(content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+                       ret = _media_svc_request_thumbnail(content_info.path, thumb_path, sizeof(thumb_path), uid);
                        if (ret == MS_MEDIA_ERR_NONE)
                                ret = __media_svc_malloc_and_strncpy(&(content_info.thumbnail_path), thumb_path);
-
-                       if (content_info.media_meta.width <= 0)
-                               content_info.media_meta.width = width;
-
-                       if (content_info.media_meta.height <= 0)
-                               content_info.media_meta.height = height;
                }
        }
 
@@ -1621,18 +1605,10 @@ int media_svc_insert_item_immediately_with_data(MediaSvcHandle *handle, media_sv
        if (_new_content_info.thumbnail_path == NULL) {
                if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
                        char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
-                       int width = 0;
-                       int height = 0;
 
-                       ret = _media_svc_request_thumbnail_with_origin_size(_new_content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+                       ret = _media_svc_request_thumbnail(_new_content_info.path, thumb_path, sizeof(thumb_path), uid);
                        if (ret == MS_MEDIA_ERR_NONE)
                                ret = __media_svc_malloc_and_strncpy(&(_new_content_info.thumbnail_path), thumb_path);
-
-                       if (_new_content_info.media_meta.width <= 0)
-                               _new_content_info.media_meta.width = width;
-
-                       if (_new_content_info.media_meta.height <= 0)
-                               _new_content_info.media_meta.height = height;
                }
        }
 
index 60db184..47795d7 100755 (executable)
@@ -65,7 +65,7 @@ time_t __media_svc_get_timeline_from_str(const char *timstr);
 void _media_svc_destroy_content_info(media_svc_content_info_s *content_info);
 char *_media_svc_replace_path(char *s, const char *olds, const char *news);
 bool _media_svc_is_drm_file(const char *path);
-int _media_svc_request_thumbnail_with_origin_size(const char *path, char *thumb_path, int max_length, int *origin_width, int *origin_height, uid_t uid);
+int _media_svc_request_thumbnail(const char *path, char *thumb_path, int max_length, uid_t uid);
 int _media_svc_get_pinyin_str(const char *src_str, char **pinyin_str);
 bool _media_svc_check_pinyin_support(void);
 int _media_svc_extract_music_metadata_for_update(sqlite3 *handle, media_svc_content_info_s *content_info, media_svc_media_type_e media_type);