From f54110fd3e844b0297ccd8ab321669857ee21ed8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 24 Oct 2014 23:47:21 +0100 Subject: [PATCH] udp: 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/udp/gstdynudpsink.c | 3 ++- gst/udp/gstmultiudpsink.c | 3 ++- gst/udp/gstudpsrc.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/udp/gstdynudpsink.c b/gst/udp/gstdynudpsink.c index 9c2b6bb..2a23ddc 100644 --- a/gst/udp/gstdynudpsink.c +++ b/gst/udp/gstdynudpsink.c @@ -574,7 +574,8 @@ gst_dynudpsink_unlock_stop (GstBaseSink * bsink) udpsink = GST_DYNUDPSINK (bsink); - g_cancellable_reset (udpsink->cancellable); + g_object_unref (udpsink->cancellable); + udpsink->cancellable = g_cancellable_new (); return TRUE; } diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c index 2f1a8ec..0b2b9dd 100644 --- a/gst/udp/gstmultiudpsink.c +++ b/gst/udp/gstmultiudpsink.c @@ -1845,7 +1845,8 @@ gst_multiudpsink_unlock_stop (GstBaseSink * bsink) sink = GST_MULTIUDPSINK (bsink); - g_cancellable_reset (sink->cancellable); + g_object_unref (sink->cancellable); + sink->cancellable = g_cancellable_new (); return TRUE; } diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index 6e3126f..9d205b8 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -1139,7 +1139,8 @@ gst_udpsrc_unlock_stop (GstBaseSrc * bsrc) src = GST_UDPSRC (bsrc); GST_LOG_OBJECT (src, "No longer flushing"); - g_cancellable_reset (src->cancellable); + g_object_unref (src->cancellable); + src->cancellable = g_cancellable_new (); return TRUE; } -- 2.7.4