[0.6.288] Fix coverity/Svace issues
[platform/core/multimedia/libmm-player.git] / src / mm_player_attrs.c
index fbf5c9b..e28f71b 100644 (file)
@@ -360,8 +360,7 @@ int __mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
 
        player = MM_PLAYER_CAST(handle);
 
-       /* apply display attr value to player handle */
-       if (!g_strrstr(attribute_name, "display"))
+       if (!g_strrstr(attribute_name, "display") || !g_strcmp0(attribute_name, "exported_shell_handle"))
                return MM_ERROR_NONE;
 
        if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_NUM)) {
@@ -948,6 +947,17 @@ MMHandleType _mmplayer_construct_attribute(MMHandleType handle)
                        NULL,
                },
                {
+                       MMPLAYER_ATTRS_DISPLAY_EXPORTED_SHELL_HANDLE,
+                       (char *)"exported_shell_handle",
+                       MM_ATTRS_TYPE_STRING,
+                       MM_ATTRS_FLAG_RW,
+                       {(void *)NULL},
+                       MM_ATTRS_VALID_TYPE_NONE,
+                       {0},
+                       {0},
+                       NULL,
+               },
+               {
                        MMPLAYER_ATTRS_SOUND_STREAM_TYPE,
                        (char *)"sound_stream_type",
                        MM_ATTRS_TYPE_STRING,
@@ -1178,13 +1188,24 @@ MMHandleType _mmplayer_construct_attribute(MMHandleType handle)
                        {.count = 0},
                        NULL,
                },
+               {
+                       MMPLAYER_ATTRS_AUDIO_ONLY,
+                       (char *)"audio_only",   /* MM_PLAYER_AUDIO_ONLY */
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       {(void *)FALSE},
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       {.int_min = FALSE},
+                       {.int_max = TRUE},
+                       NULL,
+               },
        };
 
        MMPLAYER_RETURN_VAL_IF_FAIL(handle, 0);
 
        num_of_attrs = ARRAY_SIZE(player_attrs);
 
-       base = g_try_new(MMAttrsConstructInfo, num_of_attrs);
+       base = g_try_new(MMAttrsConstructInfo, (gsize)num_of_attrs);
        if (!base) {
                LOGE("failed to alloc attrs constructor");
                return NULL;