MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / wavpack_decode_init

Function wavpack_decode_init

libavcodec/wavpack.c:1051–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1049#endif
1050
1051static av_cold int wavpack_decode_init(AVCodecContext *avctx)
1052{
1053 WavpackContext *s = avctx->priv_data;
1054
1055 s->avctx = avctx;
1056
1057 s->fdec_num = 0;
1058
1059#if HAVE_THREADS
1060 if (ff_thread_sync_ref(avctx, offsetof(WavpackContext, progress_pool)) == FF_THREAD_IS_FIRST_THREAD) {
1061 s->progress_pool = av_refstruct_pool_alloc_ext(sizeof(*s->curr_progress),
1062 AV_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR, NULL,
1063 progress_pool_init_cb,
1064 progress_pool_reset_cb,
1065 progress_pool_free_entry_cb, NULL);
1066 if (!s->progress_pool)
1067 return AVERROR(ENOMEM);
1068 }
1069#endif
1070
1071 return 0;
1072}
1073
1074static av_cold int wavpack_decode_end(AVCodecContext *avctx)
1075{

Callers

nothing calls this directly

Calls 2

ff_thread_sync_refFunction · 0.70

Tested by

no test coverage detected