[Ffmpeg-devel] [PATCH] Replace av_malloc+memset with av_mallocz
Rich Felker
dalias
Thu Sep 7 18:29:16 CEST 2006
On Thu, Sep 07, 2006 at 05:14:44PM +0200, Guillaume POIRIER wrote:
> 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:
ROTFL!
> globals are a very bad idea in the context of
> a library and multi-threading.
Exactly, this is not a context, it's a global state.
Rich
More information about the ffmpeg-devel
mailing list