From: Eunhye Choi Date: Fri, 17 Jan 2020 07:59:12 +0000 (+0900) Subject: [0.6.214] fix coverity issue X-Git-Tag: accepted/tizen/unified/20200129.022524^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a;p=platform%2Fcore%2Fmultimedia%2Flibmm-player.git [0.6.214] fix coverity issue Change-Id: I8a9ec74963a96725e02447071ac19ad65c2bfbcc --- diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index ef7ad05..e3c2b1d 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -2563,18 +2563,23 @@ __mmplayer_gst_set_pulsesink_property(mmplayer_t *player) MMPLAYER_FLEAVE(); } -void +int __mmplayer_gst_set_openalsink_property(mmplayer_t *player) { mmplayer_gst_element_t *audiobin = NULL; MMPLAYER_FENTER(); - MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->audiobin); + MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline && + player->pipeline->audiobin, MM_ERROR_PLAYER_NOT_INITIALIZED); audiobin = player->pipeline->audiobin; g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "source-ambisonics-type", 1, NULL); - sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, NULL, NULL, &stream_info); + if (sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, NULL, NULL, &stream_info)) { + LOGE("failed to create media stream info"); + return MM_ERROR_PLAYER_INTERNAL; + } + g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "stream-info", stream_info, NULL); if (player->video360_yaw_radians <= M_PI && @@ -2591,6 +2596,7 @@ __mmplayer_gst_set_openalsink_property(mmplayer_t *player) } MMPLAYER_FLEAVE(); + return MM_ERROR_NONE; } static int @@ -2728,10 +2734,12 @@ __mmplayer_gst_make_audio_playback_sink(mmplayer_t *player, GList **bucket) g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "provide-clock", FALSE, NULL); } - if (g_strrstr(player->ini.audiosink_element, "pulsesink")) + if (g_strrstr(player->ini.audiosink_element, "pulsesink")) { __mmplayer_gst_set_pulsesink_property(player); - else if (g_strrstr(player->ini.audiosink_element, "openalsink")) - __mmplayer_gst_set_openalsink_property(player); + } else if (g_strrstr(player->ini.audiosink_element, "openalsink")) { + if (__mmplayer_gst_set_openalsink_property(player) != MM_ERROR_NONE) + goto ERROR; + } /* qos on */ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "qos", TRUE, NULL); /* qos on */