Skip to content

SPU: Incorrect size report in pf_validate callback in subpicture_updater_t when window is small

Reproduced in libaribcaption module (codec/arib/libaribcaption.c) in VLC 4.x, but I haven't confirmed whether it also exists in VLC 3.x.

It has been reproduced on macOS and Windows.

https://code.videolan.org/videolan/vlc/-/blob/master/modules/codec/arib/libaribcaption.c#L112

If I resize the playback window into a small enough size, the subtitle becomes squashed. And after the resizing,

p_dst_format parameter in SubpictureValidate callback always reports an incorrect size of i_visible_width=1440, i_visible_height=1080 that is actually equal to the size of p_src_format regardless of the actual window size,

which causes the subtitle to be squashed after the window shrank.

Input video:

Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn

Expected effect: image

Actual effect after window shrank: image

Edited by xqq
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information