fftools/ffmpeg_filter: stop accessing AVCodecContext.codec

Instead pass the encoder through a newly-added output options struct,
analogous to previously added input options.

Will allow decoupling filtering from encoding in future commits.
This commit is contained in:
Anton Khirnov
2024-04-01 06:07:45 +02:00
parent 8c33085313
commit 8e35e33d42
3 changed files with 34 additions and 21 deletions

View File

@@ -1371,14 +1371,18 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
if (ost->enc &&
(type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) {
OutputFilterOptions opts = {
.enc = enc,
};
if (ofilter) {
ost->filter = ofilter;
ret = ofilter_bind_ost(ofilter, ost, ms->sch_idx_enc);
ret = ofilter_bind_ost(ofilter, ost, ms->sch_idx_enc, &opts);
if (ret < 0)
return ret;
} else {
ret = init_simple_filtergraph(ost->ist, ost, filters,
mux->sch, ms->sch_idx_enc);
mux->sch, ms->sch_idx_enc, &opts);
if (ret < 0) {
av_log(ost, AV_LOG_ERROR,
"Error initializing a simple filtergraph\n");