/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h>
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include "asf.h"
#include "buffer.h"
if( p_buf->i_size < i_default_size )
{
p_buf->i_size = i_default_size;
- if( p_buf->p_data )
- {
- free( p_buf->p_data );
- }
+ free( p_buf->p_data );
p_buf->p_data = malloc( p_buf->i_size );
}
if( !p_buf->p_data )
var_buffer_add32( p_buf, ( i_long >> 32 )&0xffffffff );
}
-
void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem )
{
/* check if there is enough data */
p_buf->i_data += i_mem;
}
-void var_buffer_addUTF16( var_buffer_t *p_buf, char *p_str )
+void var_buffer_addUTF16( var_buffer_t *p_buf, const char *p_str )
{
unsigned int i;
if( !p_str )
size_t i_in = strlen( p_str );
size_t i_out = i_in * 4;
char *psz_out, *psz_tmp;
- uint16_t *pw;
psz_out = psz_tmp = malloc( i_out + 1 );
iconv_handle = vlc_iconv_open( "UTF-16LE", "UTF-8" );
void var_buffer_free( var_buffer_t *p_buf )
{
- if( p_buf->p_data )
- {
- free( p_buf->p_data );
- }
+ free( p_buf->p_data );
p_buf->i_data = 0;
p_buf->i_size = 0;
}
return( i_byte );
}
-
uint16_t var_buffer_get16( var_buffer_t *p_buf )
{
uint16_t i_b1, i_b2;
}
if( i_copy < 0 )
{
-// fprintf( stderr, "\n**************arrrrrrggggg\n" );
i_copy = 0;
}
p_buf->i_data += i_copy;
p_guid->v4[i] = var_buffer_get8( p_buf );
}
}
-