summaryrefslogtreecommitdiffstats
path: root/gst/rtsp
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <ole.andre.ravnas@tandberg.com>2008-03-17 15:56:01 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-03-17 15:56:01 +0000
commit110a0ea563d9825b1227fd0af8d7c7f37c8dab5e (patch)
tree9cd1f369564fbd1534fe8b2291a83860e4dc8c1d /gst/rtsp
parentfbb779216cd731ee27256f2d34aadbe56fd53ad0 (diff)
gst/rtsp/gstrtspsrc.c: Call WSAStartup() and WSACleanup before using the Winsock API.
Original commit message from CVS: Patch by: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init), (gst_rtspsrc_finalize): Call WSAStartup() and WSACleanup before using the Winsock API. See #520808.
Diffstat (limited to 'gst/rtsp')
-rw-r--r--gst/rtsp/gstrtspsrc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index d3811dea..ca32b4b0 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -104,6 +104,10 @@
#include "gstrtspsrc.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#endif
+
GST_DEBUG_CATEGORY_STATIC (rtspsrc_debug);
#define GST_CAT_DEFAULT (rtspsrc_debug)
@@ -321,6 +325,14 @@ gst_rtspsrc_class_init (GstRTSPSrcClass * klass)
static void
gst_rtspsrc_init (GstRTSPSrc * src, GstRTSPSrcClass * g_class)
{
+#ifdef G_OS_WIN32
+ WSADATA wsa_data;
+
+ if (WSAStartup (MAKEWORD (2, 2), &wsa_data) != 0) {
+ GST_ERROR_OBJECT (src, "WSAStartup failed: 0x%08x", WSAGetLastError ());
+ }
+#endif
+
src->location = g_strdup (DEFAULT_LOCATION);
src->url = NULL;
@@ -368,6 +380,10 @@ gst_rtspsrc_finalize (GObject * object)
g_static_rec_mutex_free (rtspsrc->conn_rec_lock);
g_free (rtspsrc->conn_rec_lock);
+#ifdef G_OS_WIN32
+ WSACleanup ();
+#endif
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}