[vlc-commits] [Git][videolan/vlc][3.0.x] codec: libass: pass storage size to libass

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Apr 11 06:26:20 UTC 2022



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
02ba1230 by Oneric at 2022-04-11T06:13:34+00:00
codec: libass: pass storage size to libass

Due to a quirk in the ASS format some tags do depend on the exact
storage size of the video not just the pixel aspect ratio, so tell
libass via ass_set_storage_size to achieve correct rendering.

For ASS, storage size refers to the size the video is encoded in (stored
at) with codec-level crop applied; further transforms like e.g.
anamorphic de-squeezing or container-level crop must not be applied.
This matches the used fmt_src values despite them being named
visible_{width,height} and the existing PAR calculation already relies
on this.

Fixes https://code.videolan.org/videolan/vlc/-/issues/26634

(cherry picked from commit 2608eb5c82d82c209126d5d1af0dcfe48b6b9cee)

- - - - -


1 changed file:

- modules/codec/libass.c


Changes:

=====================================
modules/codec/libass.c
=====================================
@@ -440,6 +440,9 @@ static int SubpictureValidate( subpicture_t *p_subpic,
     if( b_fmt_src || b_fmt_dst )
     {
         ass_set_frame_size( p_sys->p_renderer, fmt.i_visible_width, fmt.i_visible_height );
+#if LIBASS_VERSION > 0x01010000
+        ass_set_storage_size( p_sys->p_renderer, p_fmt_src->i_visible_width, p_fmt_src->i_visible_height );
+#endif
         const double src_ratio = (double)p_fmt_src->i_visible_width / p_fmt_src->i_visible_height;
         const double dst_ratio = (double)p_fmt_dst->i_visible_width / p_fmt_dst->i_visible_height;
         ass_set_aspect_ratio( p_sys->p_renderer, dst_ratio / src_ratio, 1 );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/02ba123083c28d59788c84b2da7b82cae58b3d83

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/02ba123083c28d59788c84b2da7b82cae58b3d83
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list