[FFmpeg-devel] [PATCH 3/3 v3] h264: Run VLC init under pthread_once

Michael Niedermayer michael at niedermayer.cc
Thu Oct 8 01:50:50 CEST 2015


On Wed, Oct 07, 2015 at 10:46:50PM +0200, Hendrik Leppkes wrote:
> On Wed, Oct 7, 2015 at 10:18 PM, Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > On Wed, Oct 07, 2015 at 12:28:51PM -0400, Derek Buitenhuis wrote:
> >> This makes the h.264 decoder threadsafe to initialize.
> >
> > can you explain why it is not threadsafe currently ?
> > (assuming "done = 1" would be moved to the end of
> > ff_h264_decode_init_vlc())
> >
> 

> Validating that a complex init function doesn't produce intermittently
> incoherent states on all platforms (were reads/writes are not
> necessarily atomic) is no easy feat. Global init should be protected
> and only run once to avoid any and all unforseen issues.
> Right now its protected by the lock in avcodec - but if we want to get
> rid of that to avoid contention issues, we need new protection.

Please put this text or something similar in the commit message

thanks


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151008/34cc7df6/attachment.sig>


More information about the ffmpeg-devel mailing list