Lines Matching refs:ctx
55 AVCodecContext *ctx;
62 ctx = avcodec_alloc_context3(enc);
63 if (!ctx) {
68 ctx->sample_fmt = AV_SAMPLE_FMT_S16;
69 ctx->sample_rate = sample_rate;
70 av_channel_layout_copy(&ctx->ch_layout, ch_layout);
72 result = avcodec_open2(ctx, enc, NULL);
74 av_log(ctx, AV_LOG_ERROR, "Can't open encoder\n");
78 *enc_ctx = ctx;
85 AVCodecContext *ctx;
88 ctx = avcodec_alloc_context3(dec);
89 if (!ctx) {
94 ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
95 av_channel_layout_copy(&ctx->ch_layout, ch_layout);
97 result = avcodec_open2(ctx, dec, NULL);
99 av_log(ctx, AV_LOG_ERROR, "Can't open decoder\n");
103 *dec_ctx = ctx;