~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_libraries/ADM_libmpeg2enc/ad_layer.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <assert.h>
 
4
extern unsigned char *mpeg2enc_buffer;
 
5
void ad_putchar(unsigned int outbfr)
 
6
{
 
7
        *(mpeg2enc_buffer++)=(unsigned char )outbfr;
 
8
}
 
9
#define MAX_ALLOC 1000
 
10
static int nb_alloc=0;
 
11
static char *allocated[MAX_ALLOC];
 
12
 
 
13
/*
 
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...
 
17
*/
 
18
void *bufalloc( size_t size )
 
19
{
 
20
        void *buf=NULL; 
 
21
        if(!size) return NULL;
 
22
        
 
23
        allocated[nb_alloc]=new char[size];
 
24
        buf=(void *)allocated[nb_alloc];
 
25
        nb_alloc++;
 
26
        assert(nb_alloc<MAX_ALLOC);
 
27
        return buf;
 
28
}
 
29
 
 
30
void mpeg_freebuffers( void )
 
31
{
 
32
        for(int i=0;i<nb_alloc;i++)
 
33
        {
 
34
                delete [] allocated[i];
 
35
                allocated[i]=NULL;
 
36
        }
 
37
        nb_alloc=0;
 
38
 
 
39
}
 
 
b'\\ No newline at end of file'