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);
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);