diff options
author | Eunhye Choi <eunhae1.choi@samsung.com> | 2020-01-17 16:59:12 +0900 |
---|---|---|
committer | Eunhye Choi <eunhae1.choi@samsung.com> | 2020-01-20 14:05:46 +0900 |
commit | 24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a (patch) | |
tree | feb877c8d552ad03f3f6d0d0cd09cdd33efd8ddb | |
parent | cdc0c28e9bff5374a89b2b6ae120b2010b65abd3 (diff) | |
download | libmm-player-24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a.tar.gz libmm-player-24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a.tar.bz2 libmm-player-24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a.zip |
[0.6.214] fix coverity issuesubmit/tizen/20200120.053545accepted/tizen/unified/20200129.022524
Change-Id: I8a9ec74963a96725e02447071ac19ad65c2bfbcc
-rw-r--r-- | src/mm_player_priv.c | 20 |
1 files changed, 14 insertions, 6 deletions
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 */ |