From b96b12545f365738120b1192ee1a66607fcad420 Mon Sep 17 00:00:00 2001 From: prachi kumar Date: Thu, 8 Aug 2019 23:25:35 +0530 Subject: [PATCH] Removed Deprecated API's Change-Id: I7869ddd55326d6fa1bd4276161e011874545c54a --- common/src/vp-chapter-db.c | 24 ++++++++++++------------ common/src/vp-preview-db.c | 28 ++++++++++++++-------------- common/src/vp-thumb-db.c | 24 ++++++++++++------------ playview/src/core/vp-media-contents.c | 22 +++++++++++----------- src/common/mp-util-media-service.c | 3 ++- 5 files changed, 51 insertions(+), 50 deletions(-) diff --git a/common/src/vp-chapter-db.c b/common/src/vp-chapter-db.c index 759ca58..3b1137c 100644 --- a/common/src/vp-chapter-db.c +++ b/common/src/vp-chapter-db.c @@ -91,10 +91,10 @@ static bool _vp_chapter_db_get_count(char *szMediaID, int *nCount) vp_dbgW("Get Chapter Count : %d", *nCount); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -139,10 +139,10 @@ static bool _vp_chapter_db_delete_items(char *szMediaID) nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -316,10 +316,10 @@ bool vp_chapter_db_get_items(vp_chapter_db_h hChapterDB, nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -366,10 +366,10 @@ bool vp_chapter_db_get_all_items_media_id(vp_chapter_db_h hChapterDB, nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -426,12 +426,12 @@ bool vp_chapter_db_insert(vp_chapter_db_h hChapterDB, sqlite3_step(stmt); - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -478,12 +478,12 @@ bool vp_chapter_db_delete(vp_chapter_db_h hChapterDB) sqlite3_step(stmt); - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); diff --git a/common/src/vp-preview-db.c b/common/src/vp-preview-db.c index 706ffbc..4d6f0c9 100644 --- a/common/src/vp-preview-db.c +++ b/common/src/vp-preview-db.c @@ -91,10 +91,10 @@ static bool _vp_preview_db_get_count(char *szMediaID, int *nCount) vp_dbgW("Get Chapter Count : %d", *nCount); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -138,10 +138,10 @@ static bool _vp_preview_db_delete_item(char *szMeidaID) } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -304,10 +304,10 @@ bool vp_preview_db_get_file_path(vp_preview_db_h hPreviewDB, VP_STRDUP(*szFilePath, (char *) sqlite3_column_text(stmt, 1)); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -364,10 +364,10 @@ bool vp_preview_db_get_file_size(vp_preview_db_h hPreviewDB, *nFileSize = (int) sqlite3_column_int(stmt, 2); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -432,10 +432,10 @@ bool vp_preview_db_get_all_items_media_id(vp_preview_db_h hPreviewDB, nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -489,12 +489,12 @@ bool vp_preview_db_insert(vp_preview_db_h hPreviewDB, sqlite3_step(stmt); - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -541,12 +541,12 @@ bool vp_preview_db_delete(vp_preview_db_h hPreviewDB) sqlite3_step(stmt); - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); diff --git a/common/src/vp-thumb-db.c b/common/src/vp-thumb-db.c index 475face..1fe0fa6 100644 --- a/common/src/vp-thumb-db.c +++ b/common/src/vp-thumb-db.c @@ -94,10 +94,10 @@ static bool _vp_thumb_db_get_count(char *szMediaID, int *nCount) vp_dbgW("Get Thumb Count : %d", *nCount); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -142,10 +142,10 @@ static bool _vp_thumb_db_delete_items(char *szMediaID) nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -317,10 +317,10 @@ bool vp_thumb_db_get_items(vp_thumb_db_h hThumbDB, GList ** pThumbList) nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -365,10 +365,10 @@ bool vp_thumb_db_get_all_items_media_id(vp_thumb_db_h hThumbDB, nRet = sqlite3_step(stmt); } - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -424,12 +424,12 @@ bool vp_thumb_db_insert(vp_thumb_db_h hThumbDB, const char *szThumbPath, sqlite3_step(stmt); - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); @@ -476,12 +476,12 @@ bool vp_thumb_db_delete(vp_thumb_db_h hThumbDB) sqlite3_step(stmt); - if (stmt) { + //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL sqlite3_reset(stmt); sqlite3_clear_bindings(stmt); sqlite3_finalize(stmt); stmt = NULL; - } + //} if (szSql) { sqlite3_free(szSql); diff --git a/playview/src/core/vp-media-contents.c b/playview/src/core/vp-media-contents.c index 53f6488..6a16847 100644 --- a/playview/src/core/vp-media-contents.c +++ b/playview/src/core/vp-media-contents.c @@ -586,12 +586,12 @@ bool vp_media_contents_refresh_db(const char *szMediaID) return FALSE; } - int nRet = MEDIA_CONTENT_ERROR_NONE; - nRet = media_info_refresh_metadata_to_db(szMediaID); + /* int nRet = MEDIA_CONTENT_ERROR_NONE; + nRet = media_info_refresh_metadata_to_db(szMediaID); // Deprecated API, Parent function not called. if (nRet != MEDIA_CONTENT_ERROR_NONE) { VideoLogError("media_info_refresh_metadata_to_db fail : %d", nRet); return FALSE; - } + } */ return TRUE; } @@ -2088,11 +2088,11 @@ bool vp_media_contents_set_location_tag(const char *szFilePath, goto Exception; } - nRet = media_info_set_location_tag(pMediaHandle, pLocation); + /* nRet = media_info_set_location_tag(pMediaHandle, pLocation); // Deprecated API, Parent function not called. if (nRet != MEDIA_CONTENT_ERROR_NONE) { VideoLogError("media_info_set_location_tag is fail : 0x%x", nRet); goto Exception; - } + } */ nRet = media_info_update_to_db(pMediaHandle); if (nRet != MEDIA_CONTENT_ERROR_NONE) { @@ -2190,11 +2190,11 @@ bool vp_media_contents_get_location_tag(const char *szFilePath, goto Exception; } - nRet = media_info_get_location_tag(pMediaHandle, &szLocation); + /* nRet = media_info_get_location_tag(pMediaHandle, &szLocation); // Deprecated API, Parent function not called. if (nRet != MEDIA_CONTENT_ERROR_NONE) { VideoLogError("media_info_get_location_tag is fail : 0x%x", nRet); goto Exception; - } + } */ VP_STRDUP(*szLocationTag, szLocation); VP_FREE(szLocation); @@ -2289,11 +2289,11 @@ bool vp_media_contents_set_weahter_tag(const char *szFilePath, goto Exception; } - nRet = media_info_set_weather(pMediaHandle, pWeather); + /* nRet = media_info_set_weather(pMediaHandle, pWeather); // Deprecated API, Parent function not called. if (nRet != MEDIA_CONTENT_ERROR_NONE) { VideoLogError("media_info_set_weather is fail : 0x%x", nRet); goto Exception; - } + } */ nRet = media_info_update_to_db(pMediaHandle); if (nRet != MEDIA_CONTENT_ERROR_NONE) { @@ -2390,11 +2390,11 @@ bool vp_media_contents_get_weahter_tag(const char *szFilePath, goto Exception; } - nRet = media_info_get_weather(pMediaHandle, &szWeather); + /* nRet = media_info_get_weather(pMediaHandle, &szWeather); // Deprecated API, Parent function not called. if (nRet != MEDIA_CONTENT_ERROR_NONE) { VideoLogError("media_info_get_weather is fail : 0x%x", nRet); goto Exception; - } + } */ VP_STRDUP(*szWeatherTag, szWeather); VP_FREE(szWeather); diff --git a/src/common/mp-util-media-service.c b/src/common/mp-util-media-service.c index f0fd270..7aa4121 100644 --- a/src/common/mp-util-media-service.c +++ b/src/common/mp-util-media-service.c @@ -30,6 +30,7 @@ #include "vp-util.h" #define CAMERA_FOLDER_PATH "/opt/usr/media/Camera" +#define MEDIA_LAST_PLAYED_TIME "last_played_time" typedef struct _storage_rec_t storage_rec_s; @@ -1193,7 +1194,7 @@ void mp_util_svc_set_video_last_played_time_by_url(char *szMediaUri, VideoLogError("Fail to get pVideoMetaHandle."); } else { if (pVideoMetaHandle) { - video_meta_update_to_db(pVideoMetaHandle); + // video_meta_update_to_db(pVideoMetaHandle); // Deprecated API, Parent function not called. video_meta_destroy(pVideoMetaHandle); } else { VideoLogError("No exist pVideoMetaHandle"); -- 2.7.4