vlc | branch: master | Ilkka Ollakka <[email protected]> | Sun Sep 28 10:54:23 
2014 +0300| [7fff679f1494dbc7475a6010d45bd335f959c912] | committer: Ilkka 
Ollakka

udp: don't realloc in receiving, just set i_buffer

Similar than rtp input does, doing realloc from 64k->1.5k would
usually mean extra malloc+memcpy per packet.

Also don't pass buffer onward if we don't receive any useful stuff (-1)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7fff679f1494dbc7475a6010d45bd335f959c912
---

 modules/access/udp.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/access/udp.c b/modules/access/udp.c
index 3c18cb8..6917ee4 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -264,10 +264,10 @@ static void* ThreadRead( void *data )
             if( errno == EINTR )
                 break;
             continue;
+        } else {
+            pkt->i_buffer = len;
+            block_FifoPut( sys->fifo, pkt );
         }
-
-        pkt = block_Realloc( pkt, 0, len );
-        block_FifoPut( sys->fifo, pkt );
     }
 
     block_FifoWake( sys->fifo );

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to