ffmpeg: add per-stream input option drop_changed

This is a replacement in ffmpeg for the deprecated avcodec flag AV_CODEC_FLAG_DROPCHANGED.

This option is meant to be used when the filtergraph should not be
reinited upon input parameter changes as that leads to loss of state
in the filtergraph potentially leading to broken or aborted output,
e.g. inserting of silence with first_pts specified in aresample.

Generally useful to avoid corrupted yet decodable packets in live
streaming inputs.

This option when enabled takes precedence over reinit_filters
This commit is contained in:
Gyan Doshi
2025-03-15 16:33:05 +05:30
parent 323cb8c61e
commit cbbc927a67
5 changed files with 36 additions and 1 deletions

View File

@ -232,6 +232,7 @@ typedef struct OptionsContext {
SpecifierOptList filter_scripts;
#endif
SpecifierOptList reinit_filters;
SpecifierOptList drop_changed;
SpecifierOptList fix_sub_duration;
SpecifierOptList fix_sub_duration_heartbeat;
SpecifierOptList canvas_sizes;
@ -262,6 +263,7 @@ enum IFilterFlags {
IFILTER_FLAG_REINIT = (1 << 1),
IFILTER_FLAG_CFR = (1 << 2),
IFILTER_FLAG_CROP = (1 << 3),
IFILTER_FLAG_DROPCHANGED = (1 << 4),
};
typedef struct InputFilterOptions {