68a996940d51839b6ef20c5fa3d5d0970955b295
[buildroot.git] /
1 From 118876702467d6063e9c9745b7d093682ad16472 Mon Sep 17 00:00:00 2001
2 From: Peter Korsgaard <jacmet@sunsite.dk>
3 Date: Fri, 19 Jul 2013 15:24:08 +0200
4 Subject: [PATCH] (dyn|multi)udpsink: unbreak on !IPv6 systems after 130268bc
5 (Bind socket before using it)
6
7 The g_socket functions only touch the error argument on errors, so clear
8 err back to NULL in case g_socket_new (G_SOCKET_FAMILY_IPV6) failed, as
9 we check for err != NULL later on to know if g_socket_bind() failed,
10 otherwise we errously fail on systems without IPv6 support.
11
12 https://bugzilla.gnome.org/show_bug.cgi?id=704553
13 ---
14 gst/udp/gstdynudpsink.c | 1 +
15 gst/udp/gstmultiudpsink.c | 1 +
16 2 files changed, 2 insertions(+)
17
18 diff --git a/gst/udp/gstdynudpsink.c b/gst/udp/gstdynudpsink.c
19 index 4690bde..fadbd7f 100644
20 --- a/gst/udp/gstdynudpsink.c
21 +++ b/gst/udp/gstdynudpsink.c
22 @@ -316,6 +316,7 @@ gst_dynudpsink_start (GstBaseSink * bsink)
23 if ((udpsink->used_socket =
24 g_socket_new (G_SOCKET_FAMILY_IPV6,
25 G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_UDP, &err)) == NULL) {
26 + g_clear_error (&err);
27 udpsink->family = G_SOCKET_FAMILY_IPV4;
28 if ((udpsink->used_socket = g_socket_new (G_SOCKET_FAMILY_IPV4,
29 G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_UDP, &err)) == NULL)
30 diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c
31 index 92d1bac..69011c7 100644
32 --- a/gst/udp/gstmultiudpsink.c
33 +++ b/gst/udp/gstmultiudpsink.c
34 @@ -868,6 +868,7 @@ gst_multiudpsink_start (GstBaseSink * bsink)
35 if (sink->force_ipv4 || (sink->used_socket =
36 g_socket_new (G_SOCKET_FAMILY_IPV6,
37 G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_UDP, &err)) == NULL) {
38 + g_clear_error (&err);
39 if ((sink->used_socket = g_socket_new (G_SOCKET_FAMILY_IPV4,
40 G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_UDP, &err)) == NULL)
41 goto no_socket;
42 --
43 1.7.10.4
44