Lines Matching defs:ctx
47 AVFormatContext *ctx;
142 if (os->ctx && os->ctx_inited)
143 av_write_trailer(os->ctx);
144 if (os->ctx)
145 avio_context_free(&os->ctx->pb);
146 avformat_free_context(os->ctx);
333 AVFormatContext *ctx;
358 if (!os->ctx) {
360 ctx = avformat_alloc_context();
361 if (!ctx) {
364 os->ctx = ctx;
365 ctx->oformat = oformat;
366 ctx->interrupt_callback = s->interrupt_callback;
367 ctx->flags = s->flags;
369 ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf),
372 if (!ctx->pb) {
376 ctx = os->ctx;
380 if (!(st = avformat_new_stream(ctx, NULL))) {
388 if (c->streams[c->nb_streams].ctx)
394 if ((ret = avformat_write_header(os->ctx, NULL)) < 0) {
398 avio_flush(os->ctx->pb);
399 for (j = 0; j < os->ctx->nb_streams; j++)
400 s->streams[os->first_stream + j]->time_base = os->ctx->streams[j]->time_base;
459 avio_flush(os->ctx->pb);
524 return ff_write_chained(os->ctx, pkt->stream_index - os->first_stream, pkt, s, 0);