[vlc-commits] [Git][videolan/vlc][master] 5 commits: substext: use only visible values for original size

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Jul 9 12:27:04 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
ef2f50e2 by François Cartegnie at 2026-07-09T13:58:42+02:00
substext: use only visible values for original size

refs #25773

- - - - -
5d30f523 by François Cartegnie at 2026-07-09T13:58:42+02:00
codec: substext: unify sizes into render_fmt

- - - - -
bb2c17dd by François Cartegnie at 2026-07-09T13:58:42+02:00
codec: substext: set original size using render_fmt

- - - - -
9637aab5 by François Cartegnie at 2026-07-09T13:58:42+02:00
vout: subpictures: store previous display size

incomplete b0d8da9102d90fbb35b5ba7459bd8dd865af6dbd

- - - - -
a32aff17 by François Cartegnie at 2026-07-09T13:58:42+02:00
codec: substext: fix display change trigger

- - - - -


2 changed files:

- modules/codec/substext.h
- src/misc/subpicture.c


Changes:

=====================================
modules/codec/substext.h
=====================================
@@ -106,14 +106,28 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
     subtext_updater_sys_t *sys = subpic->updater.sys;
     const video_format_t *fmt_src = cfg->current.video_src;
     const video_format_t *fmt_dst = cfg->current.video_dst;
+    substext_updater_region_t *p_updtregion = &sys->region;
+    video_format_t render_fmt = *fmt_dst;
+    video_format_t prev_render_fmt = *cfg->previous.video_dst;
 
-    if (fmt_src->i_visible_width == cfg->previous.video_src->i_visible_width &&
-        fmt_src->i_visible_height == cfg->previous.video_src->i_visible_height &&
+    if (p_updtregion->b_in_window)
+    {
+        render_fmt.i_x_offset = render_fmt.i_y_offset = 0;
+        render_fmt.i_width  = render_fmt.i_visible_width  = cfg->current.display_width;
+        render_fmt.i_height = render_fmt.i_visible_height = cfg->current.display_height;
+        render_fmt.i_sar_num = render_fmt.i_sar_den = 1;
+        prev_render_fmt.i_x_offset = prev_render_fmt.i_y_offset = 0;
+        prev_render_fmt.i_width  = prev_render_fmt.i_visible_width  = cfg->previous.display_width;
+        prev_render_fmt.i_height = prev_render_fmt.i_visible_height = cfg->previous.display_height;
+        prev_render_fmt.i_sar_num = prev_render_fmt.i_sar_den = 1;
+    }
+
+    if (render_fmt.i_visible_width == prev_render_fmt.i_visible_width &&
+        render_fmt.i_visible_height == prev_render_fmt.i_visible_height &&
         video_format_IsSimilar(cfg->previous.video_dst, fmt_dst) &&
         (sys->i_next_update == VLC_TICK_INVALID || sys->i_next_update > cfg->pts))
         return;
 
-    substext_updater_region_t *p_updtregion = &sys->region;
 
     if (!(p_updtregion->flags & UPDT_REGION_FIXED_DONE) &&
         p_updtregion->b_absolute && !vlc_spu_regions_is_empty(&subpic->regions) &&
@@ -132,7 +146,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
     }
     vlc_spu_regions_Clear( &subpic->regions );
 
-    assert(fmt_dst->i_sar_num && fmt_dst->i_sar_den);
+    assert(render_fmt.i_sar_num && render_fmt.i_sar_den);
 
     vlc_rational_t sar;
 
@@ -162,32 +176,19 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
         sar.den = 1;
     }
 
-    if ( p_updtregion->b_in_window )
-    {
-        subpic->i_original_picture_width  = cfg->current.display_width;
-        subpic->i_original_picture_height = cfg->current.display_height;
-    }
-    else if( sys->region.flags & UPDT_REGION_USES_GRID_COORDINATES )
+    if( sys->region.flags & UPDT_REGION_USES_GRID_COORDINATES )
     {
-        subpic->i_original_picture_width  = fmt_dst->i_visible_height * sar.num / sar.den;
-        subpic->i_original_picture_height = fmt_dst->i_visible_height;
+        subpic->i_original_picture_width  = render_fmt.i_height * sar.num / sar.den;
+        subpic->i_original_picture_height = render_fmt.i_height;
     }
     else
     {
-        subpic->i_original_picture_width  = fmt_dst->i_width * fmt_dst->i_sar_num / fmt_dst->i_sar_den;
-        subpic->i_original_picture_height = fmt_dst->i_height;
+        subpic->i_original_picture_width  = render_fmt.i_width * render_fmt.i_sar_num / render_fmt.i_sar_den;
+        subpic->i_original_picture_height = render_fmt.i_height;
     }
 
     bool b_schedule_blink_update = false;
 
-    video_format_t render_fmt = *fmt_dst;
-    if (p_updtregion->b_in_window)
-    {
-        render_fmt.i_x_offset = render_fmt.i_y_offset = 0;
-        render_fmt.i_width  = render_fmt.i_visible_width  = cfg->current.display_width;
-        render_fmt.i_height = render_fmt.i_visible_height = cfg->current.display_height;
-    }
-
     for( substext_updater_region_t *update_region = &sys->region;
                                     update_region; update_region = update_region->p_next )
     {


=====================================
src/misc/subpicture.c
=====================================
@@ -210,6 +210,9 @@ void subpicture_Update( subpicture_t *p_subpicture,
 
     video_format_Copy( &p_private->src, p_fmt_src );
     video_format_Copy( &p_private->dst, p_fmt_dst );
+
+    p_private->display_width = display_width;
+    p_private->display_height = display_height;
 }
 
 typedef struct subpicture_region_private_t



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/40b7ef2df492aac025f18e3ca8729d63784a283c...a32aff17d56066a0f719857c801bc174f13e5bc2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/40b7ef2df492aac025f18e3ca8729d63784a283c...a32aff17d56066a0f719857c801bc174f13e5bc2
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