]> git.sesse.net Git - vlc/commitdiff
Only update the marquee text if needed (ie we're using % or $ chars)
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 1 Oct 2006 14:41:49 +0000 (14:41 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 1 Oct 2006 14:41:49 +0000 (14:41 +0000)
modules/video_filter/marq.c

index dcf230d17a984aefba55c229921d99de19152a65..efbd180610a4f68ffeb32722e85515073703f918 100644 (file)
@@ -570,10 +570,10 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         return NULL;
     }
 
-/*    if( p_sys->b_need_update == VLC_FALSE )
+    if( p_sys->b_need_update == VLC_FALSE )
     {
         return NULL;
-    }*/
+    }
 
     p_spu = p_filter->pf_sub_buffer_new( p_filter );
     if( !p_spu ) return NULL;
@@ -593,6 +593,14 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
 
     t = p_sys->last_time = time( NULL );
 
+    if( strchr( p_sys->psz_marquee, '%' ) || strchr( p_sys->psz_marquee, '$' ) )
+    {
+        p_sys->b_need_update = VLC_TRUE;
+    }
+    else
+    {
+        p_sys->b_need_update = VLC_FALSE;
+    }
     buf = FormatTime( p_sys->psz_marquee );
     p_spu->p_region->psz_text = FormatMeta( VLC_OBJECT( p_filter ), buf );
     free( buf );
@@ -617,7 +625,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
     }
     p_spu->p_region->p_style = p_sys->p_style;
 
-    p_sys->b_need_update = VLC_FALSE;
     return p_spu;
 }