[vlc-commits] commit: projectm: randomly choose the first preset or	projectM will always take the same. (	=?UTF-8?Q?R=C3=A9mi=20Duraffort=20?=)
    git at videolan.org 
    git at videolan.org
       
    Wed Dec  8 22:51:46 CET 2010
    
    
  
vlc/vlc-1.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Dec  7 18:41:22 2010 +0100| [0c9f902f177bec01592ed378b50feae1aac80601] | committer: Jean-Baptiste Kempf 
projectm: randomly choose the first preset or projectM will always take the same.
(cherry picked from commit 27eefb90fcc90240adaa1cfee81be68f8a727295)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=0c9f902f177bec01592ed378b50feae1aac80601
---
 modules/visualization/projectm.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index 1dd0feb..117ef8c 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -34,6 +34,7 @@
 #include <vlc_vout.h>
 #include <vlc_vout_wrapper.h>
 #include <vlc_filter.h>
+#include <vlc_rand.h>
 
 #include <libprojectM/projectM.hpp>
 
@@ -370,8 +371,8 @@ static void *Thread( void *p_data )
 
     vlc_sem_post( &p_sys->ready );
 
-    /* TODO: Give to projectm the name of the input
-    p_sys->p_projectm->projectM_setTitle( "" ); */
+    /* Choose a preset randomly or projectM will always show the first one */
+    p_sys->p_projectm->selectPreset( (unsigned)vlc_mrand48() % p_sys->p_projectm->getPlaylistSize() );
 
     /* */
     for( ;; )
    
    
More information about the vlc-commits
mailing list