[0.6.247] resolve deadlock during abort_pause 28/246428/2 submit/tizen/20201104.065942
authorEunhye Choi <eunhae1.choi@samsung.com>
Thu, 29 Oct 2020 07:23:50 +0000 (16:23 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Fri, 30 Oct 2020 01:48:28 +0000 (10:48 +0900)
- set the sinkbin state manually to avoid deadlock
- deadlock could be occurred when player set ready state to pipeline
  just before linking sinkbin

Change-Id: I17eb142ea70e85c40da7454b2f2d20f910ee4151

packaging/libmm-player.spec
src/mm_player_priv.c

index b98dc12..306e541 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.246
+Version:    0.6.247
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index b3fadf0..395e0f5 100644 (file)
@@ -3013,7 +3013,7 @@ __mmplayer_gst_make_audio_extract_sink(mmplayer_t *player, GList **bucket)
                                MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads", G_CALLBACK(__mmplayer_gst_audio_deinterleave_no_more_pads), (gpointer)player);
                player->no_more_pad = FALSE;
        } else {
-       /* 4-2. create fakesink to extract interlevaed pcm */
+       /* 4-2. create fakesink to extract interleaved pcm */
                LOGD("add audio fakesink for interleaved audio");
                MMPLAYER_CREATE_ELEMENT(audiobin, extract_sink_id, "fakesink", "fakeaudiosink", *bucket, player);
                if (!(player->audio_extract_opt & MM_PLAYER_AUDIO_EXTRACT_NO_SYNC_WITH_CLOCK))
@@ -5674,11 +5674,24 @@ _mmplayer_abort_pause(MMHandleType hplayer)
                                                player->pipeline->mainbin,
                                                MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       LOGD("set the pipeline state to READY");
+       if (player->pipeline->videobin && player->pipeline->videobin[MMPLAYER_V_BIN].gst) {
+               LOGD("set the videobin state to READY");
+               ret = _mmplayer_gst_set_state(player, player->pipeline->videobin[MMPLAYER_V_BIN].gst,
+                                                       GST_STATE_READY, TRUE, MMPLAYER_STATE_CHANGE_TIMEOUT(player));
+
+       }
+
+       if (player->pipeline->audiobin && player->pipeline->audiobin[MMPLAYER_A_BIN].gst) {
+               LOGD("set the audiobin state to READY");
+               ret = _mmplayer_gst_set_state(player, player->pipeline->audiobin[MMPLAYER_A_BIN].gst,
+                                                       GST_STATE_READY, TRUE, MMPLAYER_STATE_CHANGE_TIMEOUT(player));
 
-       /* set state to READY */
+       }
+
+       LOGD("set the pipeline state to READY");
        ret = _mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
                                                GST_STATE_READY, FALSE, MMPLAYER_STATE_CHANGE_TIMEOUT(player));
+
        if (ret != MM_ERROR_NONE) {
                LOGE("fail to change state to READY");
                return MM_ERROR_PLAYER_INTERNAL;