[vlc-commits] spu: rss: Fix bug when printing scrolling title

Daniel Glaas git at videolan.org
Fri Sep 4 09:00:13 CEST 2020


vlc | branch: master | Daniel Glaas <daniel.glaas at freenet.de> | Wed Aug 26 01:10:14 2020 +0200| [6573b9becf0ff4ce808a783328926f2371960b9b] | committer: Thomas Guillem

spu: rss: Fix bug when printing scrolling title

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.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 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 );



More information about the vlc-commits mailing list