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;
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",
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)
{
const char *sig,
const char *param[])
{
- GVariant *var;
+ GVariant *var = NULL;
if (!sig || !param) {
VideoLogInfo("!sig || !param");