OSDN Git Service

avformat/allformats: Making av_register_all() thread-safe.
authorVivekanand <sendtovivekanand@gmail.com>
Thu, 7 Apr 2016 10:46:23 +0000 (16:16 +0530)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 5 Jun 2016 21:48:12 +0000 (23:48 +0200)
commitb092ee701f4d0ef2b8a4171cd38101d1ee9a1034
tree06c9f13dfbc0866c92746822f28891f3fc43fee8
parentf730367a60e343f293a997d8ee43aed8c68a6364
avformat/allformats: Making av_register_all() thread-safe.

When multiple threads tries to call av_register_all(), the first thread sets
initialized to 1 and do the register process. At the same time, other thread might
also call av_register_all(), which returns immediately because initialized is set to 1
(even when it has not completed registering codecs). We can avoid this problem
if we set initialised to 1 while exiting from function.

Github: Closes #196
libavformat/allformats.c