[vlc-commits] [Git][videolan/vlc][master] 2 commits: dvbsub: return even earlier if there is no page

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Feb 25 07:12:28 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
85d59691 by Steve Lhomme at 2025-02-24T08:05:30+01:00
dvbsub: return even earlier if there is no page

There will be no region in the SPU and it will never be updated. We don't
need a SPU at all.

- - - - -
cf7b9589 by Steve Lhomme at 2025-02-24T08:05:30+01:00
dvbsub: remove always true flag

The regions can only use "absolute" coordinates since there is no updater.

- - - - -


1 changed file:

- modules/codec/dvbsub.c


Changes:

=====================================
modules/codec/dvbsub.c
=====================================
@@ -269,7 +269,6 @@ typedef struct
     int                i_ancillary_id;
     vlc_tick_t         i_pts;
 
-    bool               b_absolute;
     int                i_spu_position;
     int                i_spu_x;
     int                i_spu_y;
@@ -368,12 +367,10 @@ static int Open( vlc_object_t *p_this )
     i_posy = var_CreateGetInteger( p_this, DVBSUB_CFG_PREFIX "y" );
 
     /* Check if subpicture position was overridden */
-    p_sys->b_absolute = true;
     p_sys->i_spu_x = p_sys->i_spu_y = 0;
 
     if( ( i_posx >= 0 ) && ( i_posy >= 0 ) )
     {
-        p_sys->b_absolute = true;
         p_sys->i_spu_x = i_posx;
         p_sys->i_spu_y = i_posy;
     }
@@ -1485,6 +1482,11 @@ static subpicture_t *render( decoder_t *p_dec )
     int i_base_x;
     int i_base_y;
 
+    if ( p_sys->p_page == NULL)
+    {
+        return NULL;
+    }
+
     /* Allocate the subpicture internal data. */
     p_spu = decoder_NewSubpicture( p_dec, NULL );
     if( !p_spu )
@@ -1519,11 +1521,6 @@ static subpicture_t *render( decoder_t *p_dec )
         i_base_y += p_sys->display.i_y;
     }
 
-    if ( p_sys->p_page == NULL)
-    {
-        return p_spu;
-    }
-
     /* Loop on region definitions */
 #ifdef DEBUG_DVBSUB
     msg_Dbg( p_dec, "rendering %i regions", p_sys->p_page->i_region_defs );
@@ -1614,7 +1611,7 @@ static subpicture_t *render( decoder_t *p_dec )
             msg_Err( p_dec, "cannot allocate SPU region" );
             continue;
         }
-        p_spu_region->b_absolute = p_sys->b_absolute;
+        p_spu_region->b_absolute = true;
         p_spu_region->i_x = i_base_x + p_regiondef->i_x;
         p_spu_region->i_y = i_base_y + p_regiondef->i_y;
         p_spu_region->i_align = p_sys->i_spu_position;
@@ -1655,7 +1652,7 @@ static subpicture_t *render( decoder_t *p_dec )
             p_spu_region->fmt.i_height = p_spu_region->fmt.i_visible_height = p_region->i_height;
 
             p_spu_region->p_text = text_segment_New( p_object_def->psz_text );
-            p_spu_region->b_absolute = p_sys->b_absolute;
+            p_spu_region->b_absolute = true;
             p_spu_region->i_x = i_base_x + p_regiondef->i_x + p_object_def->i_x;
             p_spu_region->i_y = i_base_y + p_regiondef->i_y + p_object_def->i_y;
             p_spu_region->i_align = p_sys->i_spu_position;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d8b9b80ec8229211869e4c2cdbfd655d3ced79b5...cf7b9589d8ce97092ac17cf0ed5112a00f3962a4

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