Lines Matching defs:avctx
131 static av_cold int dpcm_decode_init(AVCodecContext *avctx)
133 DPCMContext *s = avctx->priv_data;
136 if (avctx->ch_layout.nb_channels < 1 || avctx->ch_layout.nb_channels > 2) {
137 av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
143 switch(avctx->codec->id) {
155 switch(avctx->codec_tag){
167 av_log(avctx, AV_LOG_ERROR, "Unknown SOL subcodec\n");
201 if (avctx->codec->id == AV_CODEC_ID_SOL_DPCM && avctx->codec_tag != 3)
202 avctx->sample_fmt = AV_SAMPLE_FMT_U8;
204 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
210 static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
214 DPCMContext *s = avctx->priv_data;
218 int stereo = avctx->ch_layout.nb_channels - 1;
227 switch(avctx->codec->id) {
232 out = buf_size - 6 - avctx->ch_layout.nb_channels;
235 out = buf_size - 2 * avctx->ch_layout.nb_channels;
238 if (avctx->codec_tag != 3)
250 av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
253 if (out % avctx->ch_layout.nb_channels) {
254 av_log(avctx, AV_LOG_WARNING, "channels have differing number of samples\n");
258 frame->nb_samples = (out + avctx->ch_layout.nb_channels - 1) / avctx->ch_layout.nb_channels;
259 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
264 switch(avctx->codec->id) {
290 for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++) {
310 for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++)
339 if (avctx->codec_tag != 3) {