From 76fbca7103697e5ce8f529ce9a99927e4ec0b096 Mon Sep 17 00:00:00 2001 From: Ole André Vadla Ravnås Date: Fri, 7 Mar 2008 10:01:40 +0000 Subject: gst/udp/gstudpsrc.c: Properly balance WSA_Cleanup with WSA_Startup. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: Ole André Vadla Ravnås * gst/udp/gstudpsrc.c: (gst_udpsrc_finalize), (gst_udpsrc_start), (gst_udpsrc_stop): Properly balance WSA_Cleanup with WSA_Startup. Also make the poll controllable on windows. Fixes #520888. --- gst/udp/gstudpsrc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'gst/udp') diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index a7272501..cbf120d6 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -326,6 +326,8 @@ gst_udpsrc_finalize (GObject * object) g_free (udpsrc->multi_group); g_free (udpsrc->uri); + WSA_CLEANUP (src); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -759,13 +761,8 @@ gst_udpsrc_start (GstBaseSrc * bsrc) src->myaddr.sin_port = htons (src->port + 1); -#ifdef G_OS_WIN32 - if ((src->fdset = gst_poll_new (GST_POLL_MODE_AUTO, FALSE)) == NULL) - goto no_fdset; -#else if ((src->fdset = gst_poll_new (GST_POLL_MODE_AUTO, TRUE)) == NULL) goto no_fdset; -#endif gst_poll_add_fd (src->fdset, &src->sock); gst_poll_fd_ctl_read (src->fdset, &src->sock, TRUE); @@ -877,8 +874,6 @@ gst_udpsrc_stop (GstBaseSrc * bsrc) src->fdset = NULL; } - WSA_CLEANUP (src); - return TRUE; } -- cgit