[FFmpeg-cvslog] avfilter/vf_subtitles: pass storage size to libass

Oneric git at videolan.org
Wed Mar 23 14:09:18 EET 2022


ffmpeg | branch: master | Oneric <oneric at oneric.de> | Mon Mar 14 20:06:39 2022 +0100| [66901ce16271d1e36726af53f35cb5cd88b0b773] | committer: James Almer

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 at hotmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66901ce16271d1e36726af53f35cb5cd88b0b773
---

 libavfilter/vf_subtitles.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 84ba4c7196..989bd89334 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -147,9 +147,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);
 



More information about the ffmpeg-cvslog mailing list