[FFmpeg-devel] [PATCH 5/9] lavfi/vf_subtitles: stop using deprecated ass_set_aspect_ratio()

Anton Khirnov anton at khirnov.net
Thu Nov 25 17:04:56 EET 2021


It has been deprecated in favor of ass_set_pixel_aspect() since version
0.11.0, roughly ~2014. Even Debian oldoldstable (stretch) has 0.13.
---
 configure                  | 2 +-
 libavfilter/vf_subtitles.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index d068b11073..4d9000567b 100755
--- a/configure
+++ b/configure
@@ -6430,7 +6430,7 @@ enabled libaribb24        && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "ar
                                die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
 enabled lv2               && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
 enabled libiec61883       && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
-enabled libass            && require_pkg_config libass libass ass/ass.h ass_library_init
+enabled libass            && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init
 enabled libbluray         && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
 enabled libbs2b           && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
 enabled libcelt           && require libcelt celt/celt.h celt_decode -lcelt0 &&
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 377160c72b..3fc4eeb63d 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -147,8 +147,8 @@ static int config_input(AVFilterLink *inlink)
 
     ass_set_frame_size  (ass->renderer, inlink->w, inlink->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);
+        ass_set_pixel_aspect(ass->renderer, (double)inlink->w / inlink->h /
+                             ((double)ass->original_w / ass->original_h));
     if (ass->shaping != -1)
         ass_set_shaper(ass->renderer, ass->shaping);
 
-- 
2.33.0



More information about the ffmpeg-devel mailing list