Lines Matching defs:avctx
40 static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
47 av_log(avctx, AV_LOG_ERROR, "frame is too short\n");
66 av_log(avctx, AV_LOG_ERROR, "frame has invalid header\n");
71 avctx->bits_per_raw_sample = bits;
73 avctx->sample_fmt = AV_SAMPLE_FMT_S32;
75 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
77 av_channel_layout_uninit(&avctx->ch_layout);
80 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
83 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD;
86 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1_BACK;
89 av_channel_layout_from_mask(&avctx->ch_layout,
93 avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
94 avctx->ch_layout.nb_channels = channels;
101 static int s302m_decode_frame(AVCodecContext *avctx, AVFrame *frame,
104 S302Context *s = avctx->priv_data;
111 int frame_size = s302m_parse_frame_header(avctx, buf, buf_size);
119 block_size = (avctx->bits_per_raw_sample + 4) / 4;
120 channels = avctx->ch_layout.nb_channels;
122 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
125 avctx->bit_rate = 48000 * channels * (avctx->bits_per_raw_sample + 4) +
129 if (avctx->bits_per_raw_sample == 24) {
151 } else if (avctx->bits_per_raw_sample == 20) {
196 av_log(avctx, AV_LOG_ERROR,
206 avctx->sample_rate = 48000;