diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-28 01:07:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-28 01:07:11 +0100 |
commit | 1e19927f12a2a65954aabf38b584025beff15cc3 (patch) | |
tree | 33c88297cb164490ebe38b67cf353029d9fb83f2 /libavcodec/mpegaudiodec.c | |
parent | ca55606a5127a9ddb10e4c1971c56e3e69bfd864 (diff) | |
parent | 1f948745c3cbe45c4ccd5d8996fc885d826bf3ff (diff) | |
download | ffmpeg-1e19927f12a2a65954aabf38b584025beff15cc3.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
vc1: use an enum for Frame Coding Mode
doc: cleanup filter section
indeo3: error out if no motion vector is set.
x86inc: Flag shufps as an floating-point instruction for the AVX emulation code.
mpegaudio: do not use init_static_data() for initializing tables.
musepack: fix signed shift overflow in mpc_read_packet()
mov: Make format string match variable type.
wmavoice: Make format string match variable type.
vc1: select interlaced scan table by FCM element
Generalize RIFF INFO tag support; support reading INFO tag in wav
pthread: track thread existence in a separate variable.
Conflicts:
doc/filters.texi
libavcodec/pthread.c
libavformat/avi.c
libavformat/riff.c
libavformat/riff.h
libavformat/wav.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 5ae1516d06..7dded97cf4 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -269,7 +269,7 @@ static inline int l3_unscale(int value, int exponent) return m; } -static void decode_init_static(AVCodec *codec) +static av_cold void decode_init_static(void) { int i, j, k; int offset; @@ -462,8 +462,14 @@ static void decode_init_static(AVCodec *codec) static av_cold int decode_init(AVCodecContext * avctx) { + static int initialized_tables = 0; MPADecodeContext *s = avctx->priv_data; + if (!initialized_tables) { + decode_init_static(); + initialized_tables = 1; + } + s->avctx = avctx; ff_mpadsp_init(&s->mpadsp); @@ -1996,7 +2002,6 @@ AVCodec ff_mp1_decoder = { .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), - .init_static_data = decode_init_static, .init = decode_init, .decode = decode_frame, #if FF_API_PARSE_FRAME @@ -2012,7 +2017,6 @@ AVCodec ff_mp2_decoder = { .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), - .init_static_data = decode_init_static, .init = decode_init, .decode = decode_frame, #if FF_API_PARSE_FRAME @@ -2028,7 +2032,6 @@ AVCodec ff_mp3_decoder = { .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), - .init_static_data = decode_init_static, .init = decode_init, .decode = decode_frame, #if FF_API_PARSE_FRAME @@ -2044,7 +2047,6 @@ AVCodec ff_mp3adu_decoder = { .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), - .init_static_data = decode_init_static, .init = decode_init, .decode = decode_frame_adu, #if FF_API_PARSE_FRAME @@ -2060,7 +2062,6 @@ AVCodec ff_mp3on4_decoder = { .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_MP3ON4, .priv_data_size = sizeof(MP3On4DecodeContext), - .init_static_data = decode_init_static, .init = decode_init_mp3on4, .close = decode_close_mp3on4, .decode = decode_frame_mp3on4, |