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

Function decode_init

libavcodec/dstdec.c:79–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77} DSTContext;
78
79static av_cold int decode_init(AVCodecContext *avctx)
80{
81 DSTContext *s = avctx->priv_data;
82 int i;
83
84 if (avctx->ch_layout.nb_channels > DST_MAX_CHANNELS) {
85 avpriv_request_sample(avctx, "Channel count %d", avctx->ch_layout.nb_channels);
86 return AVERROR_PATCHWELCOME;
87 }
88
89 // the sample rate is only allowed to be 64,128,256 * 44100 by ISO/IEC 14496-3:2005(E)
90 // We are a bit more tolerant here, but this check is needed to bound the size and duration
91 if (avctx->sample_rate > 512 * 44100)
92 return AVERROR_INVALIDDATA;
93
94
95 if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) {
96 return AVERROR_PATCHWELCOME;
97 }
98
99 avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
100
101 for (i = 0; i < avctx->ch_layout.nb_channels; i++)
102 memset(s->dsdctx[i].buf, 0x69, sizeof(s->dsdctx[i].buf));
103
104 ff_init_dsd_data();
105
106 return 0;
107}
108
109static int read_map(GetBitContext *gb, Table *t, unsigned int map[DST_MAX_CHANNELS], int channels)
110{

Callers

nothing calls this directly

Calls 2

avpriv_request_sampleFunction · 0.85
ff_init_dsd_dataFunction · 0.85

Tested by

no test coverage detected