[vlc-devel] [PATCH 2/3] spu: rss: Fix bug when printing scrolling title

Daniel Glaas daniel.glaas at freenet.de
Wed Aug 26 01:10:14 CEST 2020


This fixes a bug in the printing of scrolling title. As long as the title was
scrolling, the first item title was printed twice. Once by the "%s : %s" format
and the second time in the while loop afterwards some lines later.
---
 modules/spu/rss.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/spu/rss.c b/modules/spu/rss.c
index 29d44551da..0c86963843 100644
--- a/modules/spu/rss.c
+++ b/modules/spu/rss.c
@@ -442,9 +442,13 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
     else /* scrolling title */
     {
         if( i_item == -1 )
+        {
             snprintf( p_sys->psz_marquee, p_sys->i_length, "%s : %s",
                       feed_title + p_sys->i_cur_char,
                       p_feed->p_items[i_item+1].psz_title );
+            // Set i_item to 0 as the first item title was already printed.
+            i_item = 0;
+        }
         else
             snprintf( p_sys->psz_marquee, p_sys->i_length, "%s",
                       item_title + p_sys->i_cur_char );
-- 
2.17.1



More information about the vlc-devel mailing list