Lines Matching refs:avctx
115 static av_cold int dpcm_decode_init(AVCodecContext *avctx)
117 DPCMContext *s = avctx->priv_data;
120 if (avctx->channels < 1 || avctx->channels > 2) {
121 av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
127 switch(avctx->codec->id) {
139 switch(avctx->codec_tag){
151 av_log(avctx, AV_LOG_ERROR, "Unknown SOL subcodec\n");
160 if (avctx->codec->id == AV_CODEC_ID_SOL_DPCM && avctx->codec_tag != 3)
161 avctx->sample_fmt = AV_SAMPLE_FMT_U8;
163 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
169 static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
173 DPCMContext *s = avctx->priv_data;
178 int stereo = avctx->channels - 1;
187 switch(avctx->codec->id) {
192 out = buf_size - 6 - avctx->channels;
195 out = buf_size - 2 * avctx->channels;
198 if (avctx->codec_tag != 3)
205 av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
208 if (out % avctx->channels) {
209 av_log(avctx, AV_LOG_WARNING, "channels have differing number of samples\n");
213 frame->nb_samples = (out + avctx->channels - 1) / avctx->channels;
214 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
219 switch(avctx->codec->id) {
245 for (ch = 0; ch < avctx->channels; ch++) {
265 for (ch = 0; ch < avctx->channels; ch++)
295 if (avctx->codec_tag != 3) {