summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEunhye Choi <eunhae1.choi@samsung.com>2020-01-17 16:59:12 +0900
committerEunhye Choi <eunhae1.choi@samsung.com>2020-01-20 14:05:46 +0900
commit24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a (patch)
treefeb877c8d552ad03f3f6d0d0cd09cdd33efd8ddb
parentcdc0c28e9bff5374a89b2b6ae120b2010b65abd3 (diff)
downloadlibmm-player-24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a.tar.gz
libmm-player-24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a.tar.bz2
libmm-player-24c433565b8c48bbebbec8ec7d3e7cc3e6d7b99a.zip
Change-Id: I8a9ec74963a96725e02447071ac19ad65c2bfbcc
-rw-r--r--src/mm_player_priv.c20
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 */