gchar *track_name;
webrtc_gst_slot_s *sink;
GstElement *decodebin;
- GstPad *sink_pad;
+ GstPad *sink_pad = NULL;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
return WEBRTC_ERROR_NONE;
error_before_insert:
- gst_object_unref(sink_pad);
+ if (sink_pad)
+ gst_object_unref(sink_pad);
g_free(track_name);
g_free(sink);
{
if (conn_idx < 0 || conn_idx >= MAX_CONNECTION_LEN)
return;
- if (source_idx < 0 || source_idx >= MAX_MEDIA_PACKET_SOURCE_LEN)
+ if (source_idx >= MAX_MEDIA_PACKET_SOURCE_LEN)
return;
media_packet_source_s *packet_source = &g_conns[conn_idx].packet_sources[source_idx];
if (!uri)
return;
- webrtc_set_stun_server(g_conns[index].webrtc, uri);
+ ret = webrtc_set_stun_server(g_conns[index].webrtc, uri);
if (ret != WEBRTC_ERROR_NONE)
g_print("failed to webrtc_set_stun_server(), uri[%s], ret[0x%x]\n", uri, ret);
else
end:
g_free(full_path);
- close(fd);
+ if (fd != -1)
+ close(fd);
}
static void __data_channel_message_cb(webrtc_data_channel_h channel, webrtc_data_channel_type_e type, void *message, void *user_data)