GNOME Bugzilla – Bug 765249
udpsrc: external socket should not be unreffed upon disposal
Last modified: 2016-05-22 17:43:59 UTC
If udpsrc is used with external socket (passed via socket property), this socket is unreffed upon element disposal, despite ownership being not transferred. Sample code: public static int main(string[] argv) { Gst.init(ref argv); var socket = new Socket(SocketFamily.IPV4, SocketType.DATAGRAM, SocketProtocol.UDP); socket.bind(new InetSocketAddress(new InetAddress.any(SocketFamily.IPV4), 0), true); var pipeline = new Gst.Pipeline("pipeline"); dynamic Gst.Element source = Gst.ElementFactory.make("udpsrc", "source"); source.socket = socket; dynamic Gst.Element sink = Gst.ElementFactory.make("fakesink", "sink"); pipeline.add(source); pipeline.add(sink); source.link(sink); pipeline.set_state(Gst.State.PLAYING); pipeline.set_state(Gst.State.NULL); pipeline.set_state(Gst.State.PLAYING); return 0; } Compile with valac --pkg gstreamer-1.0 --pkg gio-2.0 udpsrc.vala Produces: (udpsrc:42922): GLib-GIO-CRITICAL **: g_inet_socket_address_get_address: assertion 'G_IS_INET_SOCKET_ADDRESS (address)' failed (udpsrc:42922): GLib-GIO-CRITICAL **: g_inet_address_get_is_multicast: assertion 'G_IS_INET_ADDRESS (address)' failed (udpsrc:42922): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed If the intention was to transfer ownership of socket into element, it is not documented behaviour. But IMO it should not behave like this - you may want to ensure that socket is constantly bound across state changes (e.g. so no other process will intercept it).
I don't see anything wrong in the code while shortly looking over it. Can you provide a testcase in C please? The socket property takes an additional reference when storing the socket internally
Also can you get a stacktrace of the critical? I assume it's completely unrelated to the socket, but somehow a bug with keeping track of the socket address.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!