ff_aacdec_common_init_once() already uses its own AVOnce.
Unified · Split
| @@ -61,7 +61,6 @@ · 60 unmodified lines | |||
| 61 | #include "libavutil/opt.h" | 61 | #include "libavutil/opt.h" |
| 62 | #include "libavutil/tx.h" | 62 | #include "libavutil/tx.h" |
| 63 | #include "libavutil/version.h" | 63 | #include "libavutil/version.h" |
| 64 | #include "libavutil/thread.h" | ||
| 65 | 64 | ||
| 66 | /* | 65 | /* |
| 67 | * supported tools | 66 | * supported tools |
| @@ -1112,12 +1111,6 @@ static int sample_rate_idx (int rate) · 1044 unmodified lines | |||
| 1112 | else return 11; | 1111 | else return 11; |
| 1113 | } | 1112 | } |
| 1114 | 1113 | ||
| 1115 | static av_cold void aac_static_table_init(void) | ||
| 1116 | { | ||
| 1117 | ff_aacdec_common_init_once(); | ||
| 1118 | } | ||
| 1119 | static AVOnce aac_table_init = AV_ONCE_INIT; | ||
| 1120 | |||
| 1121 | static av_cold int decode_close(AVCodecContext *avctx) | 1114 | static av_cold int decode_close(AVCodecContext *avctx) |
| 1122 | { | 1115 | { |
| 1123 | AACDecContext *ac = avctx->priv_data; | 1116 | AACDecContext *ac = avctx->priv_data; |
| @@ -1202,9 +1195,7 @@ static av_cold int aac_decode_init_internal(AVCodecContext *avctx) · 78 unmodified lines | |||
| 1202 | if (avctx->sample_rate > 96000) | 1195 | if (avctx->sample_rate > 96000) |
| 1203 | return AVERROR_INVALIDDATA; | 1196 | return AVERROR_INVALIDDATA; |
| 1204 | 1197 | ||
| 1205 | ret = ff_thread_once(&aac_table_init, &aac_static_table_init); | 1198 | ff_aacdec_common_init_once(); |
| 1206 | if (ret != 0) | ||
| 1207 | return AVERROR_UNKNOWN; | ||
| 1208 | 1199 | ||
| 1209 | ac->avctx = avctx; | 1200 | ac->avctx = avctx; |
| 1210 | ac->oc[1].m4ac.sample_rate = avctx->sample_rate; | 1201 | ac->oc[1].m4ac.sample_rate = avctx->sample_rate; |