From 853951b6467a5d2a21dc52af6c733a11f355cbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 24 Oct 2014 17:49:37 +0100 Subject: [PATCH] rtsp: don't use soon-to-be-deprecated g_cancellable_reset() From the API documentation: "Note that it is generally not a good idea to reuse an existing cancellable for more operations after it has been cancelled once, as this function might tempt you to do. The recommended practice is to drop the reference to a cancellable after cancelling it, and let it die with the outstanding async operations. You should create a fresh cancellable for further async operations." https://bugzilla.gnome.org/show_bug.cgi?id=739132 --- gst-libs/gst/rtsp/gstrtspconnection.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 50c0f8c677..08120d206f 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -2474,10 +2474,12 @@ gst_rtsp_connection_flush (GstRTSPConnection * conn, gboolean flush) { g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL); - if (flush) + if (flush) { g_cancellable_cancel (conn->cancellable); - else - g_cancellable_reset (conn->cancellable); + } else { + g_object_unref (conn->cancellable); + conn->cancellable = g_cancellable_new (); + } return GST_RTSP_OK; } @@ -2940,7 +2942,8 @@ gst_rtsp_connection_do_tunnel (GstRTSPConnection * conn, conn2->stream1 = NULL; conn2->input_stream = NULL; conn2->control_stream = NULL; - g_cancellable_reset (conn2->cancellable); + g_object_unref (conn2->cancellable); + conn2->cancellable = NULL; /* We make socket0 the write socket and socket1 the read socket. */ conn->write_socket = conn->socket0;