if (res == GST_RTSP_EINTR)
goto done;
else if (G_UNLIKELY (res == GST_RTSP_EEOF)) {
+ g_mutex_lock (&watch->mutex);
if (watch->readsrc) {
g_source_remove_child_source ((GSource *) watch, watch->readsrc);
g_source_unref (watch->readsrc);
conn->socket1 = NULL;
conn->input_stream = NULL;
}
+ g_mutex_unlock (&watch->mutex);
/* When we are in tunnelled mode, the read socket can be closed and we
* should be prepared for a new POST method to reopen it */
if (watch->funcs.tunnel_lost)
res = watch->funcs.tunnel_lost (watch, watch->user_data);
/* we add read source on the write socket able to detect when client closes get channel in tunneled mode */
+ g_mutex_lock (&watch->mutex);
if (watch->conn->control_stream && !watch->controlsrc) {
watch->controlsrc =
g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM
NULL);
g_source_add_child_source ((GSource *) watch, watch->controlsrc);
}
+ g_mutex_unlock (&watch->mutex);
goto read_done;
} else
goto eof;
void
gst_rtsp_watch_reset (GstRTSPWatch * watch)
{
+ g_mutex_lock (&watch->mutex);
if (watch->readsrc) {
g_source_remove_child_source ((GSource *) watch, watch->readsrc);
g_source_unref (watch->readsrc);
} else {
watch->controlsrc = NULL;
}
+ g_mutex_unlock (&watch->mutex);
}
/**