[Ffmpeg-devel] swscale patch

Luca Abeni lucabe72
Wed Jul 5 10:14:07 CEST 2006


Hi Michael,

On Tue, 2006-07-04 at 18:02 +0200, Michael Niedermayer wrote:
[...]
> hmm ...
> theres another problem ...
> if swscale uses some global sws_malloc() sws_free() set by global function
> pointers what will happen if 2 libs or a lib like libavcodec and the 
> application using that lib like mplayer both use sws?
Ok, I see the problem...

Would it be ok to put something like
  static int inited;

  if (inited == 0) {
    return;
  }
  inited = 1;

in sws_global_init()?
(of course, sws_global_init() should not be called in a multithreaded
environment without protecting the call with a mutex)

Or do you prefer some other kind of solution?

			Thanks,
				Luca
-- 
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !





More information about the ffmpeg-devel mailing list