[FFmpeg-devel] [PATCH] avcodec/utils: use a default lock manager that uses a spinlock

wm4 nfxjfg at googlemail.com
Fri Oct 18 00:01:55 CEST 2013


On Thu, 17 Oct 2013 15:40:36 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> That makes avformat & avcodec thread safe without the need to explicitly
> register a lock manager.

So what again is the reason that you can't do one of these things:
1. Don't use global state, but recreate it every time the user creates
   a demuxer or whatever. So there's nothing to synchronize.
2. Use pthreads, and on Windows, one of the popular pthreads wrappers.

I figure it's not quite as simple as it looks like, but badly
reimplementing the operating system/libc provided locking primitives
doesn't sound like a nice solution at all.


More information about the ffmpeg-devel mailing list