diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-04-01 06:29:16 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-04-09 10:34:18 +0200 |
commit | bc206ed1b3631801869b1bd4ddb3d3e4dd5f7aef (patch) | |
tree | d2f517822f55a8408806ceed8ca9fe9e63d6bdd7 /fftools/ffmpeg_filter.c | |
parent | 17702c5f7bfdd02bda3a29971d6d564c01971988 (diff) | |
download | ffmpeg-bc206ed1b3631801869b1bd4ddb3d3e4dd5f7aef.tar.gz |
fftools/ffmpeg_filter: stop accessing encoder AVCodecContext
Pass all the necessary value through OutputFilterOptions.
Will allow decoupling filtering from encoding in future commits.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r-- | fftools/ffmpeg_filter.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 5661dc960a..3c25d2ed65 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -782,12 +782,12 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, ofp->ts_offset = opts->ts_offset; ofp->enc_timebase = opts->output_tb; - switch (ost->enc_ctx->codec_type) { + switch (ofilter->type) { case AVMEDIA_TYPE_VIDEO: - ofp->width = ost->enc_ctx->width; - ofp->height = ost->enc_ctx->height; - if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) { - ofp->format = ost->enc_ctx->pix_fmt; + ofp->width = opts->width; + ofp->height = opts->height; + if (opts->format != AV_PIX_FMT_NONE) { + ofp->format = opts->format; } else if (opts->pix_fmts) ofp->formats = opts->pix_fmts; else if (opts->enc) @@ -812,19 +812,19 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, break; case AVMEDIA_TYPE_AUDIO: - if (ost->enc_ctx->sample_fmt != AV_SAMPLE_FMT_NONE) { - ofp->format = ost->enc_ctx->sample_fmt; + if (opts->format != AV_SAMPLE_FMT_NONE) { + ofp->format = opts->format; } else if (opts->enc) { ofp->formats = opts->enc->sample_fmts; } - if (ost->enc_ctx->sample_rate) { - ofp->sample_rate = ost->enc_ctx->sample_rate; + if (opts->sample_rate) { + ofp->sample_rate = opts->sample_rate; } else if (opts->enc) { ofp->sample_rates = opts->enc->supported_samplerates; } - if (ost->enc_ctx->ch_layout.nb_channels) { + if (opts->ch_layout.nb_channels) { int ret = set_channel_layout(ofp, opts->enc ? opts->enc->ch_layouts : NULL, - &ost->enc_ctx->ch_layout); + &opts->ch_layout); if (ret < 0) return ret; } else if (opts->enc) { |