[FFmpeg-devel] [PATCH 3/3] Add assert that the avcodec lock is held when initializing static VLC tables.

Michael Niedermayer michaelni at gmx.at
Thu Dec 6 22:07:14 CET 2012


On Tue, Nov 27, 2012 at 09:59:32PM +0100, Reimar Döffinger wrote:
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libavcodec/bitstream.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
> index ce83ee0..e986300 100644
> --- a/libavcodec/bitstream.c
> +++ b/libavcodec/bitstream.c
> @@ -30,6 +30,7 @@
>  
>  #include "libavutil/avassert.h"
>  #include "avcodec.h"
> +#include "internal.h"
>  #include "mathops.h"
>  #include "get_bits.h"
>  #include "put_bits.h"
> @@ -275,6 +276,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
>          }else if(vlc->table_size){
>              abort(); // fatal error, we are called on a partially initialized table
>          }
> +        av_assert0(ff_avcodec_locked);

this patch should be unneeded now and static vlc init be thread safe

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121206/3196d173/attachment.asc>


More information about the ffmpeg-devel mailing list