[vlc-commits] [Git][videolan/vlc][3.0.x] vout: keep the SAR when converting a snapshot for subtitle blending
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Nov 29 08:28:00 UTC 2026
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
e09536d8 by starlit at 2026-11-29T08:19:01+00:00
vout: keep the SAR when converting a snapshot for subtitle blending
When a snapshot is taken while a subtitle is on screen and the picture
can't be blended in place (e.g. VideoToolbox), ConvertRGB32AndBlend()
converts it to RGB32 using the blend filter's fmt_out, whose sample
aspect ratio is 0/0. The snapshot is then exported with square pixels:
a 720x480 picture with SAR 32:27 is saved as 720x480 instead of 853x480.
The conversion was added in f313a295 (#19892) and has never carried
the SAR.
Keep the blend filter's format and take only the SAR from the picture.
Pictures without a SAR get exactly the old format, and the converter's
size and crop handling is unchanged.
refs #30182
- - - - -
1 changed file:
- src/video_output/video_output.c
Changes:
=====================================
src/video_output/video_output.c
=====================================
@@ -935,6 +935,10 @@ static picture_t *ConvertRGB32AndBlend(vout_thread_t *vout, picture_t *pic,
return NULL;
es_format_t src = vout->p->spu_blend->fmt_out;
+ /* The blend filter's fmt_out has no sample aspect ratio, which the
+ * snapshot export treats as square pixels: take the picture's. */
+ src.video.i_sar_num = pic->format.i_sar_num;
+ src.video.i_sar_den = pic->format.i_sar_den;
es_format_t dst = src;
dst.video.i_chroma = VLC_CODEC_RGB32;
video_format_FixRgb(&dst.video);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e09536d8061835ba39dd4ca0d46a15dae5b8f02c
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e09536d8061835ba39dd4ca0d46a15dae5b8f02c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list