avcodec/h264_cavlc: Remove redundant check

The only caller to ff_h264_decode_init_vlc() already uses
ff_thread_once() for the call; ergo the check via a simple int with
static storage duration in ff_h264_decode_init_vlc() is redundant.
And if it were not redundant, it would be a potential for data races.
So remove it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
pull/371/head
Andreas Rheinhardt 4 years ago
parent cc15bb0bbf
commit b41e4f6187
  1. 5
      libavcodec/h264_cavlc.c

@ -325,12 +325,8 @@ static av_cold void init_cavlc_level_tab(void){
} }
av_cold void ff_h264_decode_init_vlc(void){ av_cold void ff_h264_decode_init_vlc(void){
static int done = 0;
if (!done) {
int i; int i;
int offset; int offset;
done = 1;
chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table; chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table;
chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size; chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size;
@ -410,7 +406,6 @@ av_cold void ff_h264_decode_init_vlc(void){
INIT_VLC_USE_NEW_STATIC); INIT_VLC_USE_NEW_STATIC);
init_cavlc_level_tab(); init_cavlc_level_tab();
}
} }
static inline int get_level_prefix(GetBitContext *gb){ static inline int get_level_prefix(GetBitContext *gb){

Loading…
Cancel
Save