From 80245e2a7049135f68ee111d8640c029b5b929fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 11 Jul 2012 12:28:23 +0100 Subject: [PATCH] multiudpsink: check the right size when warning about too large udp packets What matters is the total size, not the size of any of the individual memory chunks that make up the packet. --- gst/udp/gstmultiudpsink.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c index c80bdda..dee3459 100644 --- a/gst/udp/gstmultiudpsink.c +++ b/gst/udp/gstmultiudpsink.c @@ -468,11 +468,6 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer) mem = gst_buffer_get_memory (buffer, i); gst_memory_map (mem, &map[i], GST_MAP_READ); - if (map[i].size > UDP_MAX_SIZE) { - GST_WARNING ("Attempting to send a UDP packet larger than maximum " - "size (%" G_GSIZE_FORMAT " > %d)", map[i].size, UDP_MAX_SIZE); - } - vec[i].buffer = map[i].data; vec[i].size = map[i].size; @@ -486,6 +481,11 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer) g_mutex_lock (&sink->client_lock); GST_LOG_OBJECT (bsink, "about to send %" G_GSIZE_FORMAT " bytes", size); + if (size > UDP_MAX_SIZE) { + GST_WARNING_OBJECT (bsink, "Attempting to send a UDP packet larger than " + "maximum size (%" G_GSIZE_FORMAT " > %d)", size, UDP_MAX_SIZE); + } + no_clients = 0; num = 0; for (clients = sink->clients; clients; clients = g_list_next (clients)) { -- 2.7.4