Commit 7fff679f authored by Ilkka Ollakka's avatar 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)
parent e68826bd
...@@ -264,11 +264,11 @@ static void* ThreadRead( void *data ) ...@@ -264,11 +264,11 @@ static void* ThreadRead( void *data )
if( errno == EINTR ) if( errno == EINTR )
break; break;
continue; continue;
} } else {
pkt->i_buffer = len;
pkt = block_Realloc( pkt, 0, len );
block_FifoPut( sys->fifo, pkt ); block_FifoPut( sys->fifo, pkt );
} }
}
block_FifoWake( sys->fifo ); block_FifoWake( sys->fifo );
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment