Skip to content

codec: libass: pass storage size to libass

Oneric requested to merge Oneric/vlc:fix_ass-storage-size into master

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 #26634 (closed)


In #26634 (closed) it was speculated that some hardware decoders may theoretically already do anamorphic de-squeezing or such, thus invalidating the value. I do not know about any such case in practice and if it were to happen the existing PAR calculation would also already be wrong, so in my humble opinion using those values should be ok. Some i_original_picture_* values were also briefly mentioned in #26634 (closed) up, but I was told on IRC p_fmt_src->i_visible_* would already be initialised to the i_original_picture_* values.

See #26634 (closed) for sample files fixed by this.

Merge request reports