4
extern unsigned char *mpeg2enc_buffer;
5
void ad_putchar(unsigned int outbfr)
7
*(mpeg2enc_buffer++)=(unsigned char )outbfr;
10
static int nb_alloc=0;
11
static char *allocated[MAX_ALLOC];
14
Wrapper for malloc that allocates pbuffers aligned to the
15
specified byte boundary and checks for failure.
16
N.b. don't try to free the resulting pointers, eh...
18
void *bufalloc( size_t size )
21
if(!size) return NULL;
23
allocated[nb_alloc]=new char[size];
24
buf=(void *)allocated[nb_alloc];
26
assert(nb_alloc<MAX_ALLOC);
30
void mpeg_freebuffers( void )
32
for(int i=0;i<nb_alloc;i++)
34
delete [] allocated[i];
b'\\ No newline at end of file'