diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-27 21:28:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-27 21:31:49 +0200 |
commit | f44be0da946c9b434bccfd9128eb77dca1de14d0 (patch) | |
tree | edc4f6939ea06691999839494a664b0f8ed94bae /libavcodec/ituh263dec.c | |
parent | 5f9cbad60372ecb478570098727ac2e73925c67d (diff) | |
download | ffmpeg-f44be0da946c9b434bccfd9128eb77dca1de14d0.tar.gz |
ff_h263_decode_init_vlc: fix order of operations to avoid failure with 2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ituh263dec.c')
-rw-r--r-- | libavcodec/ituh263dec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 6d432337bd..86c5c0638a 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -102,11 +102,9 @@ static VLC cbpc_b_vlc; /* XXX: find a better solution to handle static init */ void ff_h263_decode_init_vlc(MpegEncContext *s) { - static int done = 0; + static volatile int done = 0; if (!done) { - done = 1; - INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, ff_h263_intra_MCBPC_bits, 1, 1, ff_h263_intra_MCBPC_code, 1, 1, 72); @@ -129,6 +127,7 @@ void ff_h263_decode_init_vlc(MpegEncContext *s) INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, &ff_cbpc_b_tab[0][1], 2, 1, &ff_cbpc_b_tab[0][0], 2, 1, 8); + done = 1; } } |