webrtc: Add missing return check when changing pipeline state to READY/PLAYING 65/253365/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 9 Feb 2021 07:25:42 +0000 (16:25 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 9 Feb 2021 07:25:42 +0000 (16:25 +0900)
[Version] 0.1.110
[Issue Type] Bug fix

Change-Id: I349a7da7e39a95bf0c93e7a81d9f97165e75c309
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc.c

index bf26971903dddc30db27ddb9d39862e219d47d03..68032fea68261956598e99b29bd21c083b549247 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.1.109
+Version:    0.1.110
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 4bbf5355128955a3cd4a9120a4bc6e53ea9285cd..84e945e1468212df852bc77ef80d69db38bfc17a 100644 (file)
@@ -209,7 +209,9 @@ int webrtc_start(webrtc_h webrtc)
                return ret;
        }
 #endif
-       _gst_pipeline_set_state(webrtc, GST_STATE_PLAYING);
+       ret = _gst_pipeline_set_state(webrtc, GST_STATE_PLAYING);
+       RET_VAL_WITH_UNLOCK_IF(ret != WEBRTC_ERROR_NONE, ret, &_webrtc->mutex, "failed to change GST state to PLAYING");
+
        _webrtc->pend_state = WEBRTC_STATE_NEGOTIATING;
 
        LOG_INFO("webrtc[%p] is started", webrtc);
@@ -841,7 +843,8 @@ int webrtc_create_data_channel(webrtc_h webrtc, const char *label, webrtc_data_c
 
        RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be IDLE");
 
-       _gst_pipeline_set_state(_webrtc, GST_STATE_READY);
+       ret = _gst_pipeline_set_state(_webrtc, GST_STATE_READY);
+       RET_VAL_WITH_UNLOCK_IF(ret != WEBRTC_ERROR_NONE, ret, &_webrtc->mutex, "failed to change GST state to READY");
 
        ret = _create_data_channel(webrtc, label, (webrtc_data_channel_s **)channel);