#else /*_USE_TVPD_MODE*/
void ms_device_block_changed_cb(ms_block_info_s *block_info, void *user_data)
{
+ int ret = MS_MEDIA_ERR_NONE;
MS_DBG_WARN("GET EXTERNAL EVENT");
+
+ ret = ms_load_functions();
+ if (ret != MS_MEDIA_ERR_NONE) {
+ MS_DBG_ERR("plugin load failed");
+ return;
+ }
+
if (block_info->mount_path != NULL && block_info->mount_uuid != NULL) {
MS_DBG("uuid[%s] path[%s]", block_info->mount_uuid, block_info->mount_path);
} else {
MS_DBG_ERR("mount_path or mount_uuid is NULL");
}
+
+ ms_unload_functions();
}
#endif /*_USE_TVPD_MODE*/
GIOChannel *channel = NULL;
bool is_dcm_supported = __ms_is_dcm_supported();
power_off = false;
+#ifdef _USE_TVPD_MODE
int ret = 0;
+#endif
int sockfd = -1;
resource_pid_t stResource = {};
MS_DBG_ERR("Start CPU Boost 0, pid[%d]", stResource.pid);
}
+#ifdef _USE_TVPD_MODE
ret = ms_load_functions();
if (ret != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("ms_load_functions failed [%d]", ret);
return -1;
}
-#ifdef _USE_TVPD_MODE
uid_t uid = MEDIA_DEFAULT_UID;
uint64_t db_size = 0;
uint64_t free_space = 0;
__ms_new_global_variable();
if (ms_cynara_initialize() != MS_MEDIA_ERR_NONE) {
+#ifdef _USE_TVPD_MODE
ms_unload_functions();
+#endif
MS_DBG_ERR("Failed to initialize cynara");
resource_clear_cpu_boosting(stResource);
return -1;
g_thread_join(dcm_thread);
ms_cynara_finish();
+#ifdef _USE_TVPD_MODE
ms_unload_functions();
-
+#endif
__ms_free_global_variable();
MS_DBG_INFO("Media Server is shutting down");
static void __ms_check_mediadb(void)
{
-#ifndef _USE_MULTI_USER
+ int ret = MS_MEDIA_ERR_NONE;
+#ifdef _USE_TVPD_MODE
uid_t uid = MEDIA_DEFAULT_UID;
sqlite3 *db_handle = NULL;
- int ret = MS_MEDIA_ERR_NONE;
ms_sys_get_uid(&uid);
return;
}
-#ifdef _USE_TVPD_MODE
if (ms_set_storage_scan_status(db_handle, NULL, MEDIA_SCAN_PREPARE, uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("ms_set_storage_scan_status fail");
-#endif
+
/*update just valid type*/
if (ms_set_all_storage_validity(db_handle, 0, uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("ms_set_all_storage_validity fail");
-#ifdef _USE_TVPD_MODE
/* auto scan tv interal storage */
char *internal_path = NULL;
ms_sys_get_uid(&uid);
ms_user_get_internal_root_path(uid, &internal_path);
ms_send_storage_scan_request(internal_path, INTERNAL_STORAGE_ID, MS_SCAN_PART, uid);
g_free(internal_path);
-#endif
+
ms_disconnect_db(db_handle);
#endif
/* update external storage */
- if (__ms_is_external_supported())
+ if (__ms_is_external_supported()) {
+#ifdef _USE_TVPD_MODE
__ms_update_storage_status();
+#else
+ ret = ms_load_functions();
+ if (ret != MS_MEDIA_ERR_NONE) {
+ MS_DBG_ERR("ms_load_functions failed [%d]", ret);
+ return;
+ }
+ __ms_update_storage_status();
+ ms_unload_functions();
+#endif
+ }
}
static bool __ms_is_dcm_supported(void)