* @param[in] param1 the name of param is key, must be local variable. never be pointer.
* @param[in] type2 The enum of parameter type. Muse be one of thease(INT, INT64, POINTER, DOUBLE, STRING, ARRAY)
* @param[in] param2 the name of param is key, must be local variable. never be pointer.
+ * @param[out] ret set ERROR when fail to send msg.
*/
-#define player_msg_create_handle(api, fd, type1, param1, type2, param2) \
+#define player_msg_create_handle(api, fd, type1, param1, type2, param2, 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; \
} \
} while (0)
Name: capi-media-player
Summary: A Media Player API
-Version: 0.3.84
+Version: 0.3.85
Release: 0
Group: Multimedia/API
License: Apache-2.0
goto ERROR;
}
- player_msg_create_handle(api, sock_fd, INT, module, INT, pid);
+ player_msg_create_handle(api, sock_fd, INT, module, INT, pid, ret);
+ if (ret == PLAYER_ERROR_INVALID_OPERATION)
+ goto ERROR;
pc->cb_info = callback_new(sock_fd);
if (!pc->cb_info) {
#endif
if (push_media.buf_type == PUSH_MEDIA_BUF_TYPE_RAW) {
buf_size = (int)push_media.size;
- muse_client_ipc_push_data(pc->cb_info->data_fd, buf, buf_size, push_media.pts);
+ if (muse_client_ipc_push_data(pc->cb_info->data_fd, buf, buf_size, push_media.pts) < 0) {
+ LOGE("failed to send data");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
player_msg_send_array(api, pc, ret_buf, ret, push_media_msg, msg_size, sizeof(char));
}
media_packet_destroy(g_audio_pkt);
g_audio_pkt = NULL;
}
- media_packet_create_alloc(g_audio_fmt, NULL, NULL, &g_audio_pkt);
+
+ if (media_packet_create_alloc(g_audio_fmt, NULL, NULL, &g_audio_pkt) != MEDIA_PACKET_ERROR_NONE) {
+ g_print("media_packet_create_alloc failed\n");
+ goto EXIT;
+ }
g_print("packet = %p, src = %p\n", g_audio_pkt, src);
}
}
- fseek(fd, -(zero_count + 1), SEEK_CUR);
+ if (fseek(fd, -(zero_count + 1), SEEK_CUR) < 0) {
+ LOGE("failed fseek");
+ return -1;
+ }
if (nal_unit_type == 0x7) {
sps_len = nal_length;
g_video_pkt = NULL;
}
- media_packet_create_alloc(g_video_fmt, NULL, NULL, &g_video_pkt);
+ if (media_packet_create_alloc(g_video_fmt, NULL, NULL, &g_video_pkt) != MEDIA_PACKET_ERROR_NONE) {
+ g_print("media_packet_create_alloc failed\n");
+ goto EXIT;
+ }
g_print("packet = %p, src = %p\n", g_video_pkt, src);
media_packet_destroy(g_audio_pkt);
g_audio_pkt = NULL;
}
- media_packet_create_alloc(g_audio_fmt, NULL, NULL, &g_audio_pkt);
+
+ if (media_packet_create_alloc(g_audio_fmt, NULL, NULL, &g_audio_pkt) != MEDIA_PACKET_ERROR_NONE) {
+ g_print("media_packet_create_alloc failed\n");
+ goto EXIT;
+ }
g_print("packet = %p, src = %p\n", g_audio_pkt, src);