[vlc-commits] freetype: remove unused karaoke durations

Francois Cartegnie git at videolan.org
Thu Jul 4 10:23:33 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jul  1 18:19:21 2019 +0200| [93613cfd66c57255f7b7d03e1f8816c43ca2768f] | committer: Francois Cartegnie

freetype: remove unused karaoke durations

karaoke feature has been killed when html parsing
has been removed.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93613cfd66c57255f7b7d03e1f8816c43ca2768f
---

 modules/text_renderer/freetype/freetype.c    |  7 -------
 modules/text_renderer/freetype/text_layout.c | 18 ++----------------
 modules/text_renderer/freetype/text_layout.h |  1 -
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index abd5b0fbc2..d26a3972a4 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1382,12 +1382,6 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
             if( !rv )
                 break;
         }
-
-        /* With karaoke, we're going to have to render the text a number
-         * of times to show the progress marker on the text.
-         */
-        if( text_block.pi_k_durations )
-            var_SetBool( p_filter, "text-rerender", true );
     }
 
     FreeLines( text_block.p_laid );
@@ -1396,7 +1390,6 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
     FreeStylesArray( text_block.pp_styles, text_block.i_count );
     if( text_block.pp_ruby )
         FreeRubyBlockArray( text_block.pp_ruby, text_block.i_count );
-    free( text_block.pi_k_durations );
 
     return rv;
 }
diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index 073f1b8283..52cfd9be90 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -304,7 +304,6 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
                                   const uni_char_t *p_code_points,
                                   text_style_t **pp_styles,
                                   ruby_block_t **pp_ruby,
-                                  uint32_t *pi_k_dates,
                                   int i_runs_size )
 {
     paragraph_t *p_paragraph = calloc( 1, sizeof( paragraph_t ) );
@@ -348,15 +347,6 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
     if( p_paragraph->pp_ruby )
         memcpy( p_paragraph->pp_ruby, pp_ruby, i_size * sizeof( *pp_ruby ) );
 
-    if( pi_k_dates )
-    {
-        int64_t i_elapsed  = MS_FROM_VLC_TICK(var_GetInteger( p_filter, "spu-elapsed" ));
-        for( int i = 0; i < i_size; ++i )
-        {
-            p_paragraph->pi_karaoke_bar[ i ] = pi_k_dates[ i ] >= i_elapsed;
-        }
-    }
-
 #ifdef HAVE_HARFBUZZ
     p_paragraph->p_scripts = vlc_alloc( i_size, sizeof( *p_paragraph->p_scripts ) );
     if( !p_paragraph->p_scripts )
@@ -831,7 +821,7 @@ static int ShapeParagraphHarfBuzz( filter_t *p_filter,
     }
 
     p_new_paragraph = NewParagraph( p_filter, i_total_glyphs,
-                                    NULL, NULL, NULL, NULL,
+                                    NULL, NULL, NULL,
                                     p_paragraph->i_runs_size );
     if( !p_new_paragraph )
     {
@@ -1647,7 +1637,6 @@ static paragraph_t * BuildParagraph( filter_t *p_filter,
                                      const uni_char_t *p_uchars,
                                      text_style_t **pp_styles,
                                      ruby_block_t **pp_ruby,
-                                     uint32_t *pi_k_dates,
                                      int i_runs_size,
                                      unsigned *pi_max_advance_x )
 {
@@ -1655,7 +1644,6 @@ static paragraph_t * BuildParagraph( filter_t *p_filter,
                                 p_uchars,
                                 pp_styles,
                                 pp_ruby,
-                                pi_k_dates,
                                 i_runs_size );
     if( !p_paragraph )
         return NULL;
@@ -1712,7 +1700,7 @@ static int LayoutRubyText( filter_t *p_filter,
 
     paragraph_t *p_paragraph = BuildParagraph( p_filter, i_uchars,
                                                p_uchars, pp_styles,
-                                               NULL, NULL, 1,
+                                               NULL, 1,
                                                &i_max_advance_x );
     if( !p_paragraph )
     {
@@ -1780,8 +1768,6 @@ int LayoutTextBlock( filter_t *p_filter,
                                     &p_textblock->pp_styles[i_paragraph_start],
                                     p_textblock->pp_ruby ?
                                     &p_textblock->pp_ruby[i_paragraph_start] : NULL,
-                                    p_textblock->pi_k_durations ?
-                                    &p_textblock->pi_k_durations[i_paragraph_start] : NULL,
                                     20, &i_max_advance_x );
             if( !p_paragraph )
             {
diff --git a/modules/text_renderer/freetype/text_layout.h b/modules/text_renderer/freetype/text_layout.h
index 408a3a8beb..7f70b0d2a5 100644
--- a/modules/text_renderer/freetype/text_layout.h
+++ b/modules/text_renderer/freetype/text_layout.h
@@ -85,7 +85,6 @@ typedef struct
     uni_char_t *p_uchars;       /*!< array of size \p i_count character codepoints */
     text_style_t **pp_styles;   /*!< array of size \p i_count character styles */
     ruby_block_t **pp_ruby;     /*!< array of size \p  */
-    uint32_t *pi_k_durations;   /*!< array of size \p i_count karaoke timestamps */
     size_t i_count;             /*!< length of the arrays */
 
     bool b_balanced;            /*!< true for grid-mode text */



More information about the vlc-commits mailing list