diff options
author | Oneric <oneric@oneric.de> | 2022-03-23 20:43:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-06 20:27:35 +0200 |
commit | 7ccd77a8ffbad3d56a86043d17b730a46074f0e9 (patch) | |
tree | ae3c05c65b455347622d2a071a87b2e7019de07f | |
parent | b90c01a501382dce57b5579687e860d428b324dc (diff) | |
download | ffmpeg-7ccd77a8ffbad3d56a86043d17b730a46074f0e9.tar.gz |
avfilter/vf_subtitles: pass storage size to libass
Due to a quirk of the ASS format some tags depend on the exact storage
resolution of the video, so tell libass via ass_set_storage_size.
-rw-r--r-- | libavfilter/vf_subtitles.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index de74afa2b7..b57dd80b13 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -145,9 +145,16 @@ static int config_input(AVFilterLink *inlink) ff_draw_init(&ass->draw, inlink->format, ass->alpha ? FF_DRAW_PROCESS_ALPHA : 0); ass_set_frame_size (ass->renderer, inlink->w, inlink->h); - if (ass->original_w && ass->original_h) + if (ass->original_w && ass->original_h) { ass_set_aspect_ratio(ass->renderer, (double)inlink->w / inlink->h, (double)ass->original_w / ass->original_h); +#if LIBASS_VERSION > 0x01010000 + ass_set_storage_size(ass->renderer, ass->original_w, ass->original_h); + } else { + ass_set_storage_size(ass->renderer, inlink->w, inlink->h); +#endif + } + if (ass->shaping != -1) ass_set_shaper(ass->renderer, ass->shaping); |