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.
This commit is contained in:
Tim-Philipp Müller 2012-07-11 12:28:23 +01:00
parent ab77c424be
commit 80245e2a70

View file

@ -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)) {