* @param[in] module The server side module infomation.
* @param[in] fd socket fd
*/
-#define muse_core_send_module_addr(module, fd) \
+#define muse_core_send_module_addr(module, fd, ret) \
do {\
char *__sndMsg__; \
int __len__; \
muse_core_msg_free(__sndMsg__); \
if (__len__ <= 0) { \
LOGE("sending message failed"); \
- return PLAYER_ERROR_INVALID_OPERATION; \
+ ret = PLAYER_ERROR_INVALID_OPERATION; \
+ goto ERROR; \
} \
} while (0)
*player = (player_h) pc;
if (player_msg_get_type(module_addr, ret_buf, POINTER)) {
pc->cb_info->data_fd = muse_client_new_data_ch();
- muse_core_send_module_addr(module_addr, pc->cb_info->data_fd);
+ if (!muse_core_fd_is_valid(pc->cb_info->data_fd)) {
+ LOGE("Failed to get data_fd");
+ ret = PLAYER_ERROR_INVALID_OPERATION;
+ goto ERROR;
+ }
+
+ muse_core_send_module_addr(module_addr, pc->cb_info->data_fd, ret);
LOGD("Data channel fd %d, muse module addr %p", pc->cb_info->data_fd, module_addr);
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
goto ERROR;
}
SERVER_TIMEOUT(pc) = MAX_SERVER_TIME_OUT; /* will be update after prepare phase. */
- } else
+ } else {
goto ERROR;
+ }
#ifdef TIZEN_FEATURE_EVAS_RENDERER
pc->cb_info->evas_info = g_new0(player_evas_info_s, 1);
if (pc->cb_info->evas_info == NULL) {