Remove unused functions 14/151314/1
authorRavi Kiran K N <ravi.kiran@samsung.com>
Wed, 20 Sep 2017 11:15:30 +0000 (16:45 +0530)
committerRavi Kiran K N <ravi.kiran@samsung.com>
Wed, 20 Sep 2017 11:15:30 +0000 (16:45 +0530)
Fix SVACE issues

Change-Id: I624a2debf4649437784edcd02df3d03501f52066
Signed-off-by: Ravi Kiran K N <ravi.kiran@samsung.com>
playview/src/common/include/vp-play-util.h
playview/src/common/vp-play-util.c

index 3333e45..fa657df 100644 (file)
@@ -49,8 +49,6 @@ bool vp_play_util_save_file(const char *szFileName, char *szBuffer,
                                                        int nSize);
 bool vp_play_util_get_network_status(void);
 bool vp_play_util_is_exist_subtitle_from_path(const char *szPath);
-bool vp_play_util_get_subtitles_from_path(const char *szPath,
-                                                                                 GList ** pSubtitleList);
 bool vp_play_util_get_subtitle_path_list(GList ** subtitleList);
 bool vp_play_util_check_personal_status(const char *szPreviewUrl);
 
index f870b2c..4fc3a01 100644 (file)
@@ -211,10 +211,12 @@ char *vp_play_util_get_folder_from_path(char *szFilePath)
                szTitleName = szFilePath;
        }
 
-       szFile = calloc(1, nLength - strlen(szTitleName));
+       if (nLength > strlen(szTitleName)) {
+               szFile = calloc(1, nLength - strlen(szTitleName));
 
-       if (szFile != NULL) {
-               strncpy(szFile, szFilePath, nLength - strlen(szTitleName) - 1);
+               if (szFile != NULL) {
+                       strncpy(szFile, szFilePath, nLength - strlen(szTitleName) - 1);
+               }
        }
 
        return szFile;
@@ -362,7 +364,7 @@ bool vp_play_util_get_subtitle_path(const char *szMediaURL,
                memset(szCheckFilePath, 0, nOutputLen);
                strncpy(szCheckFilePath, szMediaURL, nStrLength);
                strncat(szCheckFilePath, szExtWildkey[nCount],
-                               strlen(szExtWildkey[nCount]));
+                               strlen(szExtWildkey[nCount] + 1));
 
                if (!stat(szCheckFilePath, &buf)) {
                        VideoLogWarning("Success finding subtitle file. - %d, %s",
@@ -847,56 +849,6 @@ bool vp_play_util_is_exist_subtitle_from_path(const char *szPath)
        return FALSE;
 }
 
-bool vp_play_util_get_subtitles_from_path(const char *szPath,
-                                                                                 GList ** pSubtitleList)
-{
-       if (szPath == NULL) {
-               VideoLogError("szPath is NULL");
-               return FALSE;
-       }
-
-       Eina_List *pFileList = NULL;
-       Eina_List *pItemList = NULL;
-       char *szFileName = NULL;
-       char szExtWildkey[6][5] = { ".srt", ".sub", ".smi", ".SRT", ".SUB", ".SMI" };
-
-
-       pFileList = vp_file_ls(szPath);
-
-       if (pFileList == NULL) {
-               VideoLogError("pFileList is NULL");
-               return FALSE;
-       }
-
-       EINA_LIST_FOREACH(pFileList, pItemList, szFileName) {
-               if (szFileName == NULL) {
-                       continue;
-               } else {
-                       char *szName = vp_strip_ext(szFileName);
-                       char *szExt = NULL;
-
-                       int nIdx = 0;
-                       if (szName == NULL) {
-                               continue;
-                       }
-                       szExt = szFileName + strlen(szName);
-                       for (nIdx = 0; nIdx < 6; nIdx++) {
-                               if (strcmp(szExt, szExtWildkey[nIdx]) == 0) {
-                                       char *szSubtitleName = NULL;
-                                       szSubtitleName =
-                                               g_strdup_printf("%s/%s", szPath, szFileName);
-                                       *pSubtitleList =
-                                               g_list_append(*pSubtitleList, szSubtitleName);
-                               }
-                       }
-                       VP_FREE(szName);
-               }
-       }
-
-       eina_list_free(pFileList);
-
-       return TRUE;
-}
 
 bool vp_play_util_get_subtitle_path_list(GList ** subtitleList)
 {
@@ -1180,7 +1132,7 @@ static int __vp_play_util_append_variant(GDBusMessage * msg,
                                                                                 const char *sig,
                                                                                 const char *param[])
 {
-       GVariant *var;
+       GVariant *var = NULL;
 
        if (!sig || !param) {
                VideoLogInfo("!sig || !param");