Lines Matching defs:avctx
63 AVCodecContext *avctx;
103 avctx = avcodec_alloc_context3(input_codec);
104 if (!avctx) {
111 error = avcodec_parameters_to_context(avctx, stream->codecpar);
114 avcodec_free_context(&avctx);
119 if ((error = avcodec_open2(avctx, input_codec, NULL)) < 0) {
122 avcodec_free_context(&avctx);
128 avctx->pkt_timebase = stream->time_base;
131 *input_codec_context = avctx;
151 AVCodecContext *avctx = NULL;
200 avctx = avcodec_alloc_context3(output_codec);
201 if (!avctx) {
209 av_channel_layout_default(&avctx->ch_layout, OUTPUT_CHANNELS);
210 avctx->sample_rate = input_codec_context->sample_rate;
211 avctx->sample_fmt = output_codec->sample_fmts[0];
212 avctx->bit_rate = OUTPUT_BIT_RATE;
221 avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
224 if ((error = avcodec_open2(avctx, output_codec, NULL)) < 0) {
230 error = avcodec_parameters_from_context(stream->codecpar, avctx);
237 *output_codec_context = avctx;
242 avcodec_free_context(&avctx);