[vlc-commits] [Git][videolan/vlc][3.0.x] Revert "codec: libass: add support for sub-text-scale"

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Tue Oct 12 12:24:39 UTC 2021



Rémi Denis-Courmont pushed to branch 3.0.x at VideoLAN / VLC


Commits:
1f870b73 by Francois Cartegnie at 2021-10-12T12:12:41+00:00
Revert "codec: libass: add support for sub-text-scale"

This reverts commit 72fd3b20f855198959e0dfb6b331acc5cb4502c6.

we can't recurse object tree properly

- - - - -


1 changed file:

- modules/codec/libass.c


Changes:

=====================================
modules/codec/libass.c
=====================================
@@ -78,14 +78,12 @@ static void Flush( decoder_t * );
 struct decoder_sys_t
 {
     mtime_t        i_max_stop;
-    int            i_scale;
 
     /* The following fields of decoder_sys_t are shared between decoder and spu units */
     vlc_mutex_t    lock;
     int            i_refcount;
 
     /* */
-    vlc_object_t *p_callbackobj;
     ASS_Library    *p_library;
     ASS_Renderer   *p_renderer;
     video_format_t fmt;
@@ -128,19 +126,6 @@ typedef struct
 static int BuildRegions( rectangle_t *p_region, int i_max_region, ASS_Image *p_img_list, int i_width, int i_height );
 static void RegionDraw( subpicture_region_t *p_region, ASS_Image *p_img );
 
-static int ScalingCallback (vlc_object_t *obj, const char *var,
-                            vlc_value_t old, vlc_value_t cur, void *data)
-{
-    decoder_sys_t *p_sys = data;
-    VLC_UNUSED(obj);
-    VLC_UNUSED(var);
-    VLC_UNUSED(old);
-    vlc_mutex_lock(&p_sys->lock);
-    p_sys->i_scale = cur.i_int;
-    vlc_mutex_unlock(&p_sys->lock);
-    return VLC_SUCCESS;
-}
-
 //#define DEBUG_REGION
 
 /*****************************************************************************
@@ -166,7 +151,6 @@ static int Create( vlc_object_t *p_this )
     p_sys->i_refcount = 1;
     memset( &p_sys->fmt, 0, sizeof(p_sys->fmt) );
     p_sys->i_max_stop = VLC_TS_INVALID;
-    p_sys->i_scale = var_InheritInteger( p_dec, "sub-text-scale" );
     p_sys->p_library  = NULL;
     p_sys->p_renderer = NULL;
     p_sys->p_track    = NULL;
@@ -298,18 +282,6 @@ static int Create( vlc_object_t *p_this )
     }
     ass_process_codec_private( p_track, p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
 
-    vlc_value_t val;
-    for ( vlc_object_t *obj = p_dec; obj; obj = obj->obj.parent )
-    {
-        if( var_GetChecked( obj,  "sub-text-scale" ,
-                            VLC_VAR_INTEGER, &val ) == VLC_SUCCESS )
-        {
-            var_AddCallback( obj, "sub-text-scale", ScalingCallback, p_sys );
-            p_sys->p_callbackobj = obj;
-            break;
-        }
-    }
-
     p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
 
     return VLC_SUCCESS;
@@ -342,11 +314,6 @@ static void DecSysRelease( decoder_sys_t *p_sys )
         return;
     }
     vlc_mutex_unlock( &p_sys->lock );
-
-    if( p_sys->p_callbackobj )
-        var_DelCallback( p_sys->p_callbackobj, "sub-text-scale",
-                         ScalingCallback, p_sys );
-
     vlc_mutex_destroy( &p_sys->lock );
 
     if( p_sys->p_track )
@@ -479,8 +446,6 @@ static int SubpictureValidate( subpicture_t *p_subpic,
         p_sys->fmt = fmt;
     }
 
-    ass_set_font_scale( p_sys->p_renderer, p_sys->i_scale / 100.0 );
-
     /* */
     const mtime_t i_stream_date = p_subpic->updater.p_sys->i_pts + (i_ts - p_subpic->i_start);
     int i_changed;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1f870b73e0e65901b42a1fcf33dbb031c9a1e163

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1f870b73e0e65901b42a1fcf33dbb031c9a1e163
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list