[FFmpeg-cvslog] avfilter/vf_subtitles: pass storage size to libass
Oneric
git at videolan.org
Thu Apr 14 01:09:30 EEST 2022
ffmpeg | branch: release/3.4 | Oneric <oneric at oneric.de> | Wed Mar 23 20:43:54 2022 +0100| [1c73b96c21a2484f144648996578e325cc1bc62e] | committer: Michael Niedermayer
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1c73b96c21a2484f144648996578e325cc1bc62e
---
libavfilter/vf_subtitles.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 66a564699a..39c40bf458 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);
More information about the ffmpeg-cvslog
mailing list