aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOneric <oneric@oneric.de>2022-03-14 20:06:39 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-04 00:05:36 +0200
commit482d51884c06a15a2712eb7629fbdd21720f61e9 (patch)
treebac23158c8198340d72cf7db93717aee2348c2fe
parenta50aa980eb46ab7d291cb4645825405d26c843d0 (diff)
downloadffmpeg-482d51884c06a15a2712eb7629fbdd21720f61e9.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. Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavfilter/vf_subtitles.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 3fc4eeb63d..aa5d17b8bc 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -146,9 +146,13 @@ 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_pixel_aspect(ass->renderer, (double)inlink->w / inlink->h /
((double)ass->original_w / ass->original_h));
+ ass_set_storage_size(ass->renderer, ass->original_w, ass->original_h);
+ } else
+ ass_set_storage_size(ass->renderer, inlink->w, inlink->h);
+
if (ass->shaping != -1)
ass_set_shaper(ass->renderer, ass->shaping);