After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697608 - netclientclock: gst_net_client_clock_start() always fails on windows
netclientclock: gst_net_client_clock_start() always fails on windows
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Windows
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-09 07:12 UTC by LRN
Modified: 2013-04-09 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
netclientclock: bind socket before querying local address (1.74 KB, patch)
2013-04-09 09:21 UTC, Tim-Philipp Müller
committed Details | Review

Description LRN 2013-04-09 07:12:51 UTC
gst_net_client_clock_start() does this:

  socket = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM,
      G_SOCKET_PROTOCOL_UDP, &error);

  if (socket == NULL)
    goto no_socket;

  /* check address we're bound to, mostly for debugging purposes */
  myaddr = g_socket_get_local_address (socket, &error);

  if (myaddr == NULL)
    goto getsockname_error;

...

getsockname_error:
  {
    GST_ERROR_OBJECT (self, "get_local_address() failed: %s", error->message);
    g_error_free (error);
    g_object_unref (socket);
    return FALSE;
  }

g_socket_get_local_address() always fails on unbound sockets (and this socket is unbound), so gst_net_client_clock_start() always fails.
Comment 1 Tim-Philipp Müller 2013-04-09 09:21:03 UTC
Created attachment 241037 [details] [review]
netclientclock: bind socket before querying local address

Does this help?
Comment 2 LRN 2013-04-09 09:34:00 UTC
_should_ it be bound at all? The comment states that address is mostly for debugging...
Comment 3 Tim-Philipp Müller 2013-04-09 11:05:28 UTC
I think so. We want to receive packets back from the time provider after all. Maybe on *nix the udp socket gets bound automatically.

Could you test it?
Comment 4 Sebastian Dröge (slomo) 2013-04-09 18:01:13 UTC
Comment on attachment 241037 [details] [review]
netclientclock: bind socket before querying local address

That changes is correct in any case, I'm surprised it works with the other order on Linux :)
Comment 5 Tim-Philipp Müller 2013-04-09 18:40:00 UTC
commit 6e5405e9ce7465c1cc441debc8164a9b842699ed
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Tue Apr 9 10:17:45 2013 +0100

    netclientclock: bind socket before querying local address
    
    Fails on windows otherwise.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697608