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

Function wv_dsd_reset

libavcodec/wavpack.c:990–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

988}
989
990static int wv_dsd_reset(WavpackContext *s, int channels)
991{
992 int i;
993
994 s->dsd_channels = 0;
995 av_refstruct_unref(&s->dsdctx);
996 av_refstruct_unref(&s->curr_progress);
997 av_refstruct_unref(&s->prev_progress);
998
999 if (!channels)
1000 return 0;
1001
1002 if (WV_MAX_CHANNELS > SIZE_MAX / sizeof(*s->dsdctx) &&
1003 channels > SIZE_MAX / sizeof(*s->dsdctx))
1004 return AVERROR(EINVAL);
1005
1006 s->dsdctx = av_refstruct_allocz(channels * sizeof(*s->dsdctx));
1007 if (!s->dsdctx)
1008 return AVERROR(ENOMEM);
1009 s->dsd_channels = channels;
1010
1011 for (i = 0; i < channels; i++)
1012 memset(s->dsdctx[i].buf, 0x69, sizeof(s->dsdctx[i].buf));
1013
1014 ff_init_dsd_data();
1015
1016 return 0;
1017}
1018
1019#if HAVE_THREADS
1020static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)

Callers 3

wavpack_decode_endFunction · 0.85
wavpack_decode_blockFunction · 0.85
wavpack_decode_flushFunction · 0.85

Calls 3

av_refstruct_unrefFunction · 0.85
av_refstruct_alloczFunction · 0.85
ff_init_dsd_dataFunction · 0.85

Tested by

no test coverage detected