souphttpsrc: Protect input stream with lock

This was the last remaining place where modifying/unreffing the
input stream was not protected by the lock

https://bugzilla.gnome.org/show_bug.cgi?id=796639
This commit is contained in:
Edward Hervey 2018-06-20 10:03:59 +02:00 committed by Edward Hervey
parent f2f15a119f
commit 8842d51ff8

View file

@ -454,10 +454,12 @@ gst_soup_http_src_reset (GstSoupHTTPSrc * src)
src->increase_blocksize_count = 0;
g_cancellable_reset (src->cancellable);
g_mutex_lock (&src->mutex);
if (src->input_stream) {
g_object_unref (src->input_stream);
src->input_stream = NULL;
}
g_mutex_unlock (&src->mutex);
gst_caps_replace (&src->src_caps, NULL);
g_free (src->iradio_name);
@ -1519,6 +1521,7 @@ gst_soup_http_src_build_message (GstSoupHTTPSrc * src, const gchar * method)
return TRUE;
}
/* Lock taken */
static GstFlowReturn
gst_soup_http_src_send_message (GstSoupHTTPSrc * src)
{
@ -1526,6 +1529,7 @@ gst_soup_http_src_send_message (GstSoupHTTPSrc * src)
GError *error = NULL;
g_return_val_if_fail (src->msg != NULL, GST_FLOW_ERROR);
g_assert (src->input_stream == NULL);
src->input_stream =
soup_session_send (src->session, src->msg, src->cancellable, &error);