Lines Matching refs:avctx
86 static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
89 EightSvxContext *esc = avctx->priv_data;
97 int chan_size = avpkt->size / avctx->channels - hdr_size;
99 if (avpkt->size % avctx->channels) {
100 av_log(avctx, AV_LOG_WARNING, "Packet with odd size, ignoring last byte\n");
102 if (avpkt->size < (hdr_size + 1) * avctx->channels) {
103 av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
108 if (avctx->channels == 2)
115 if (avctx->channels == 2) {
122 if (avctx->channels == 2)
126 av_log(avctx, AV_LOG_ERROR, "unexpected empty packet\n");
139 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
142 for (ch = 0; ch < avctx->channels; ch++) {
151 return ((avctx->frame_number == 0)*hdr_size + buf_size)*avctx->channels;
154 static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
156 EightSvxContext *esc = avctx->priv_data;
158 if (avctx->channels < 1 || avctx->channels > 2) {
159 av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");
163 switch (avctx->codec->id) {
167 av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);
170 avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
175 static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
177 EightSvxContext *esc = avctx->priv_data;