summaryrefslogtreecommitdiffstats
path: root/gst/udp/gstudpsink.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2005-05-11 07:31:22 +0000
committerWim Taymans <wim.taymans@gmail.com>2005-05-11 07:31:22 +0000
commit6cacd6f64958db92328a9ae52563160a583a395a (patch)
tree21114bd6951fc81554f60e4ff82bcec043954d1b /gst/udp/gstudpsink.c
parente4978ff8dcc23bb2d919e8717dd6a02aae9d73ce (diff)
gst/: UDP fixes, added uri handler.
Original commit message from CVS: * gst/rtp/Makefile.am: * gst/rtp/gstrtp.c: (plugin_init): * gst/rtp/gstrtpdec.c: (gst_rtpdec_get_type), (gst_rtpdec_class_init), (gst_rtpdec_init), (gst_rtpdec_chain_rtp), (gst_rtpdec_chain_rtcp), (gst_rtpdec_set_property), (gst_rtpdec_get_property), (gst_rtpdec_change_state), (gst_rtpdec_plugin_init): * gst/rtp/gstrtpdec.h: * gst/udp/gstudpsink.c: (gst_udpsink_base_init), (gst_udpsink_get_times), (gst_udpsink_render), (gst_udpsink_change_state): * gst/udp/gstudpsrc.c: (gst_udpsrc_get_type), (gst_udpsrc_base_init), (gst_udpsrc_class_init), (gst_udpsrc_init), (gst_udpsrc_loop), (gst_udpsrc_set_uri), (gst_udpsrc_set_property), (gst_udpsrc_get_property), (gst_udpsrc_init_receive), (gst_udpsrc_activate), (gst_udpsrc_change_state), (gst_udpsrc_uri_get_type), (gst_udpsrc_uri_get_protocols), (gst_udpsrc_uri_get_uri), (gst_udpsrc_uri_set_uri), (gst_udpsrc_uri_handler_init): * gst/udp/gstudpsrc.h: UDP fixes, added uri handler. Added rtpdec that will manage the RTP session in the future.
Diffstat (limited to 'gst/udp/gstudpsink.c')
-rw-r--r--gst/udp/gstudpsink.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gst/udp/gstudpsink.c b/gst/udp/gstudpsink.c
index 7f9206f9..93fb654b 100644
--- a/gst/udp/gstudpsink.c
+++ b/gst/udp/gstudpsink.c
@@ -161,26 +161,27 @@ static GstFlowReturn
gst_udpsink_render (GstBaseSink * sink, GstBuffer * buffer)
{
GstUDPSink *udpsink;
- guint tolen, i;
gint tosend;
guint8 *data;
udpsink = GST_UDPSINK (sink);
- tolen = sizeof (udpsink->theiraddr);
-
tosend = GST_BUFFER_SIZE (buffer);
data = GST_BUFFER_DATA (buffer);
/* send in chunks of MTU */
while (tosend > 0) {
- if (sendto (udpsink->sock, data, udpsink->mtu,
- 0, (struct sockaddr *) &udpsink->theiraddr, tolen) == -1) {
+ gint psize;
+
+ psize = MIN (udpsink->mtu, tosend);
+ if (sendto (udpsink->sock, data, psize, 0,
+ (struct sockaddr *) &udpsink->theiraddr,
+ sizeof (udpsink->theiraddr)) == -1) {
perror ("sending");
}
- data += udpsink->mtu;
- tosend -= udpsink->mtu;
+ data += psize;
+ tosend -= psize;
}
return GST_FLOW_OK;