Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer authored on 2013/12/06 23:38:20... | ... |
@@ -1750,12 +1750,19 @@ static void qdm2_synthesis_filter(QDM2Context *q, int index) |
1750 | 1750 |
* |
1751 | 1751 |
* @param q context |
1752 | 1752 |
*/ |
1753 |
-static av_cold void qdm2_init_static_data(AVCodec *codec) { |
|
1753 |
+static av_cold void qdm2_init_static_data(void) { |
|
1754 |
+ static int done; |
|
1755 |
+ |
|
1756 |
+ if(done) |
|
1757 |
+ return; |
|
1758 |
+ |
|
1754 | 1759 |
qdm2_init_vlc(); |
1755 | 1760 |
ff_mpa_synth_init_float(ff_mpa_synth_window_float); |
1756 | 1761 |
softclip_table_init(); |
1757 | 1762 |
rnd_table_init(); |
1758 | 1763 |
init_noise_samples(); |
1764 |
+ |
|
1765 |
+ done = 1; |
|
1759 | 1766 |
} |
1760 | 1767 |
|
1761 | 1768 |
/** |
... | ... |
@@ -1768,6 +1775,8 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) |
1768 | 1768 |
int extradata_size; |
1769 | 1769 |
int tmp_val, tmp, size; |
1770 | 1770 |
|
1771 |
+ qdm2_init_static_data(); |
|
1772 |
+ |
|
1771 | 1773 |
/* extradata parsing |
1772 | 1774 |
|
1773 | 1775 |
Structure: |
... | ... |
@@ -2044,7 +2053,6 @@ AVCodec ff_qdm2_decoder = { |
2044 | 2044 |
.id = AV_CODEC_ID_QDM2, |
2045 | 2045 |
.priv_data_size = sizeof(QDM2Context), |
2046 | 2046 |
.init = qdm2_decode_init, |
2047 |
- .init_static_data = qdm2_init_static_data, |
|
2048 | 2047 |
.close = qdm2_decode_close, |
2049 | 2048 |
.decode = qdm2_decode_frame, |
2050 | 2049 |
.capabilities = CODEC_CAP_DR1, |