[Ffmpeg-devel] [PATCH] Replace av_malloc+memset with av_mallocz

Guillaume POIRIER poirierg
Thu Sep 7 17:14:44 CEST 2006


Hi,

On 9/7/06, Daniel Serpell <daniel_serpell at yahoo.com> wrote:
> Hi!
>
> El Thu, Sep 07, 2006 at 10:55:56AM -0400, Rich Felker escribio:
> > On Thu, Sep 07, 2006 at 10:03:43AM -0400, Daniel Serpell wrote:
> > >
> > > It can be done easily now using custom av_malloc / av_free functions.
> >
> > Not it can't because av_malloc does not take a context as an argument.
> > (I'm not saying it should, just that it can't do what I said.)
>
> Yes, you will need to set the malloc/free context (of your aplication)
> before calling any avcodec API, using some sort of global variable.
>
> I agree, not very good, but could work.

Before Rich flames you: globals are a very bad idea in the context of
a library and multi-threading.

Guillaume
-- 
With DADVSI (http://en.wikipedia.org/wiki/DADVSI), France finally has
a lead on USA on selling out individuals right to corporations!
Vive la France!




More information about the ffmpeg-devel mailing list