[0.2.65] Fix Coverity issues 35/155835/3 accepted/tizen/4.0/unified/20171018.061031 submit/tizen_4.0/20171017.101825 tizen_4.0.m2_release
authorGilbok Lee <gilbok.lee@samsung.com>
Mon, 16 Oct 2017 08:51:38 +0000 (17:51 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 17 Oct 2017 10:01:56 +0000 (19:01 +0900)
Change-Id: I4856744376644b893389ceb034af863edc6cc155

legacy/src/legacy_player.c
muse/include/muse_player_msg.h
packaging/mmsvc-player.spec

index fd9565af9ed43486656e3b50fb1b9fe0d3fdb407..36a4aa55d9dfc7da0e69fdcdaabbc8114f54949f 100644 (file)
@@ -706,8 +706,11 @@ static int __msg_callback(int message, void *param, void *user_data)
                break;
        case MM_MESSAGE_SEEK_COMPLETED: /* 0x114 */
                if (handle->display_type != PLAYER_DISPLAY_TYPE_NONE && handle->state == PLAYER_STATE_READY) {
-                       if (handle->is_display_visible)
-                               mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL);
+                       if (handle->is_display_visible) {
+                               int ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL);
+                               if (ret != MM_ERROR_NONE)
+                                       LOGW("[%s] Failed to set display_visible '1' (0x%x)", __FUNCTION__, ret);
+                       }
                }
                if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
                        __ADD_MESSAGE(handle, PLAYER_MESSAGE_SEEK_DONE);
@@ -1571,9 +1574,11 @@ int legacy_player_start(player_h player)
        player_s *handle = (player_s *)player;
        int ret;
        if (handle->state == PLAYER_STATE_READY || handle->state == PLAYER_STATE_PAUSED) {
-               if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY && handle->is_display_visible)
+               if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY && handle->is_display_visible) {
                        ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL);
-
+                       if (ret != MM_ERROR_NONE)
+                               LOGW("[%s] Failed to set display_visible '1' (0x%x)", __FUNCTION__, ret);
+               }
                if (handle->is_stopped) {
                        if (handle->is_progressive_download) {
                                LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
@@ -1613,9 +1618,8 @@ int legacy_player_stop(player_h player)
        if (handle->state == PLAYER_STATE_PLAYING || handle->state == PLAYER_STATE_PAUSED) {
                if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
                        ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 0, (char *)NULL);
-                       if (ret != MM_ERROR_NONE) {
+                       if (ret != MM_ERROR_NONE)
                                LOGW("[%s] Failed to set display_visible '0' (0x%x)", __FUNCTION__, ret);
-                       }
                }
 
                ret = mm_player_stop(handle->mm_handle);
index 8a87033226ed1b0bb6a279d1006eec3b2f786727..911db7bd68457e750e59ccb21f18434dab63276e 100644 (file)
@@ -257,7 +257,7 @@ typedef struct {
 #define player_send_msg_with_no_return(fd, msg) \
        do { \
                int __len__ = 0; \
-               if (fd != MM_ERROR_INVALID_ARGUMENT) {  \
+               if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) {   \
                        __len__ = muse_core_msg_send(fd, msg); \
                        if (__len__ <= 0) \
                                LOGE("sending message failed"); \
@@ -269,7 +269,7 @@ typedef struct {
 #define player_send_msg(fd, msg, ret) \
        do { \
                int __len__ = 0; \
-               if (fd != MM_ERROR_INVALID_ARGUMENT) {  \
+               if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) {   \
                        __len__ = muse_core_msg_send(fd, msg); \
                        if (__len__ <= 0) { \
                                LOGE("sending message failed"); \
@@ -284,7 +284,7 @@ typedef struct {
 #define player_send_msg_with_fd(fd, tfd, msg) \
        do { \
                int __len__ = 0; \
-               if (fd != MM_ERROR_INVALID_ARGUMENT) {  \
+               if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) {   \
                        __len__ = muse_core_msg_send_fd(fd, tfd, msg); \
                        if (__len__ <= 0) \
                                LOGE("sending message failed"); \
index 074dd8eb8362c1e5b6ab70ae543bf15e94299bf9..70c7b8e31028949faac3e3c76d7967856d23b1ff 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.64
+Version:    0.2.65
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0