diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 15:38:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 15:40:44 +0100 |
commit | 976fc5911c42783854d422eb1adcf4b57e6758f1 (patch) | |
tree | a803fb5cfb8e27a15a7831be3e02f5489d4af45f /libavcodec | |
parent | 133fbfc7811ffae7b97dd129fcd0b5e646742362 (diff) | |
download | ffmpeg-976fc5911c42783854d422eb1adcf4b57e6758f1.tar.gz |
avcodec/qdm2: move static init to normal init to avoid initializing tables that might never be used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/qdm2.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 0a9eea057a..bf830db940 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1750,12 +1750,19 @@ static void qdm2_synthesis_filter(QDM2Context *q, int index) * * @param q context */ -static av_cold void qdm2_init_static_data(AVCodec *codec) { +static av_cold void qdm2_init_static_data(void) { + static int done; + + if(done) + return; + qdm2_init_vlc(); ff_mpa_synth_init_float(ff_mpa_synth_window_float); softclip_table_init(); rnd_table_init(); init_noise_samples(); + + done = 1; } /** @@ -1768,6 +1775,8 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) int extradata_size; int tmp_val, tmp, size; + qdm2_init_static_data(); + /* extradata parsing Structure: @@ -2044,7 +2053,6 @@ AVCodec ff_qdm2_decoder = { .id = AV_CODEC_ID_QDM2, .priv_data_size = sizeof(QDM2Context), .init = qdm2_decode_init, - .init_static_data = qdm2_init_static_data, .close = qdm2_decode_close, .decode = qdm2_decode_frame, .capabilities = CODEC_CAP_DR1, |