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 | e903c31fd159a48bd6bbc8cb9cdd45fd67727650 (patch) | |
tree | 990c8b56fd0feb46d18d0758b17446f604fbf5c3 /fftools/ffmpeg_filter.c | |
parent | b3864e7a080d5716d6a6d8dd8e327ed6c6dd2d2f (diff) | |
download | ffmpeg-e903c31fd159a48bd6bbc8cb9cdd45fd67727650.tar.gz |
fftools/ffmpeg_filter: pass keep_pix_fmt through OutputFilterOptions
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r-- | fftools/ffmpeg_filter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 8b05262622..5f2dbc387e 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -214,6 +214,8 @@ typedef struct OutputFilterPriv { int64_t ts_offset; int64_t next_pts; FPSConvContext fps; + + unsigned flags; } OutputFilterPriv; static OutputFilterPriv *ofp_from_ofilter(OutputFilter *ofilter) @@ -355,11 +357,10 @@ static int choose_pix_fmts(OutputFilter *ofilter, AVBPrint *bprint, const char **dst) { OutputFilterPriv *ofp = ofp_from_ofilter(ofilter); - OutputStream *ost = ofilter->ost; *dst = NULL; - if (ost->keep_pix_fmt || ofp->format != AV_PIX_FMT_NONE) { + if (ofp->flags & OFILTER_FLAG_DISABLE_CONVERT || ofp->format != AV_PIX_FMT_NONE) { *dst = ofp->format == AV_PIX_FMT_NONE ? NULL : av_get_pix_fmt_name(ofp->format); } else if (ofp->formats) { @@ -777,6 +778,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, ofilter->ost = ost; av_freep(&ofilter->linklabel); + ofp->flags = opts->flags; ofp->ts_offset = opts->ts_offset; ofp->enc_timebase = ost->enc_timebase; @@ -814,7 +816,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, } } - fgp->disable_conversions |= ost->keep_pix_fmt; + fgp->disable_conversions |= !!(ofp->flags & OFILTER_FLAG_DISABLE_CONVERT); ofp->fps.last_frame = av_frame_alloc(); if (!ofp->fps.last_frame) |