[NUT-devel] [NUT] (ods15): r71 - /trunk/libnut/muxer.c

syncmail at mplayerhq.hu syncmail at mplayerhq.hu
Sat Feb 25 16:13:23 CET 2006


Author: ods15
Date: Sat Feb 25 16:13:22 2006
New Revision: 71

Log:
cosmetics and small optimization

Modified:
    trunk/libnut/muxer.c

Modified: trunk/libnut/muxer.c
==============================================================================
--- trunk/libnut/muxer.c (original)
+++ trunk/libnut/muxer.c Sat Feb 25 16:13:22 2006
@@ -59,7 +59,7 @@
 }
 
 static output_buffer_t * new_mem_buffer() {
-	output_buffer_t *bc = malloc(sizeof(output_buffer_t));
+	output_buffer_t * bc = malloc(sizeof(output_buffer_t));
 	bc->write_len = PREALLOC_SIZE;
 	bc->is_mem = 1;
 	bc->file_pos = 0;
@@ -68,7 +68,7 @@
 }
 
 static output_buffer_t * new_output_buffer(nut_output_stream_t osc) {
-	output_buffer_t *bc = new_mem_buffer();
+	output_buffer_t * bc = new_mem_buffer();
 	bc->is_mem = 0;
 	bc->osc = osc;
 	if (!bc->osc.write) bc->osc.write = stream_write;
@@ -118,7 +118,7 @@
 static void put_data(output_buffer_t * bc, int len, const uint8_t * data) {
 	if (!len) return;
 	assert(data);
-	if (len < PREALLOC_SIZE || bc->is_mem) {
+	if (bc->write_len - (bc->buf_ptr - bc->buf) > len || bc->is_mem) {
 		ready_write_buf(bc, len);
 		memcpy(bc->buf_ptr, data, len);
 		bc->buf_ptr += len;




More information about the NUT-devel mailing list