multiudpsink: avoid some unnecessary run-time type checks

This commit is contained in:
Tim-Philipp Müller 2014-06-19 14:59:48 +01:00
parent 98a4ee0f92
commit 3512ad3be0
2 changed files with 3 additions and 3 deletions

View file

@ -526,7 +526,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
gint num, no_clients;
GError *err = NULL;
sink = GST_MULTIUDPSINK (bsink);
sink = GST_MULTIUDPSINK_CAST (bsink);
n_mem = gst_buffer_n_memory (buffer);
if (n_mem == 0)
@ -1327,9 +1327,8 @@ gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
client->refcount--;
if (client->refcount == 0) {
GInetSocketAddress *saddr = G_INET_SOCKET_ADDRESS (client->addr);
GSocketFamily family = g_socket_address_get_family (client->addr);
GInetAddress *addr = g_inet_socket_address_get_address (saddr);
GSocketFamily family =
g_socket_address_get_family (G_SOCKET_ADDRESS (saddr));
GSocket *socket;
/* Select socket to send from for this address */

View file

@ -33,6 +33,7 @@ G_BEGIN_DECLS
#define GST_MULTIUDPSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIUDPSINK,GstMultiUDPSinkClass))
#define GST_IS_MULTIUDPSINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIUDPSINK))
#define GST_IS_MULTIUDPSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIUDPSINK))
#define GST_MULTIUDPSINK_CAST(obj) ((GstMultiUDPSink*)(obj))
typedef struct _GstMultiUDPSink GstMultiUDPSink;
typedef struct _GstMultiUDPSinkClass GstMultiUDPSinkClass;