]> git.sesse.net Git - vlc/blobdiff - modules/visualization/goom.c
* modules/visualization/goom.c: increased buffer queue size (was too low for some...
[vlc] / modules / visualization / goom.c
index 96d87927ea28491264f0cb2327727742fdda15d7..80c1bbb426b3fd658526bff85528074324b1fb66 100644 (file)
 #include <vlc/vout.h>
 #include "aout_internal.h"
 
-#include "goom_core.h"
+#ifdef USE_GOOM_TREE
+#   ifdef OLD_GOOM
+#       include "goom_core.h"
+#       define PluginInfo void
+#       define goom_update(a,b,c,d,e,f) goom_update(b,c,d,e,f)
+#       define goom_close(a) goom_close()
+#       define goom_init(a,b) NULL; goom_init(a,b,0); goom_set_font(0,0,0)
+#   else
+#       include "goom.h"
+#   endif
+#else
+#   include <goom/goom.h>
+#endif
 
 /*****************************************************************************
  * Module descriptor
@@ -46,11 +58,11 @@ static void Close        ( vlc_object_t * );
 #define WIDTH_TEXT N_("Goom display width")
 #define HEIGHT_TEXT N_("Goom display height")
 #define RES_LONGTEXT N_("Allows you to change the resolution of the " \
-  "goom display (bigger resolution will be prettier but more CPU intensive).")
+  "Goom display (bigger resolution will be prettier but more CPU intensive).")
 
 #define SPEED_TEXT N_("Goom animation speed")
 #define SPEED_LONGTEXT N_("Allows you to reduce the speed of the animation " \
-  "(default 7, max 10).")
+  "(default 6, max 10).")
 
 #define MAX_SPEED 10
 
@@ -61,7 +73,7 @@ vlc_module_begin();
                  WIDTH_TEXT, RES_LONGTEXT, VLC_FALSE );
     add_integer( "goom-height", 240, NULL,
                  HEIGHT_TEXT, RES_LONGTEXT, VLC_FALSE );
-    add_integer( "goom-speed", 7, NULL,
+    add_integer( "goom-speed", 6, NULL,
                  SPEED_TEXT, SPEED_LONGTEXT, VLC_FALSE );
     set_callbacks( Open, Close );
     add_shortcut( "goom" );
@@ -70,7 +82,7 @@ vlc_module_end();
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-#define MAX_BLOCKS 10
+#define MAX_BLOCKS 100
 #define GOOM_DELAY 400000
 
 typedef struct
@@ -297,6 +309,7 @@ static void Thread( vlc_object_t *p_this )
     audio_date_t i_pts;
     int16_t p_data[2][512];
     int i_data = 0, i_count = 0;
+    PluginInfo *p_plugin_info;
 
     var_Get( p_this, "goom-width", &width );
     var_Get( p_this, "goom-height", &height );
@@ -306,8 +319,7 @@ static void Thread( vlc_object_t *p_this )
     speed.i_int = MAX_SPEED - speed.i_int;
     if( speed.i_int < 0 ) speed.i_int = 0;
 
-    goom_init( width.i_int, height.i_int, 0 );
-    goom_set_font( NULL, NULL, NULL );
+    p_plugin_info = goom_init( width.i_int, height.i_int );
 
     while( !p_thread->b_die )
     {
@@ -327,7 +339,8 @@ static void Thread( vlc_object_t *p_this )
         /* Frame dropping if necessary */
         if( aout_DateGet( &i_pts ) + GOOM_DELAY <= mdate() ) continue;
 
-        plane = goom_update( p_data, 0, 0.0, p_thread->psz_title, NULL );
+        plane = goom_update( p_plugin_info, p_data, 0, 0.0,
+                             p_thread->psz_title, NULL );
 
         if( p_thread->psz_title )
         {
@@ -349,7 +362,7 @@ static void Thread( vlc_object_t *p_this )
         vout_DisplayPicture( p_thread->p_vout, p_pic );
     }
 
-    goom_close();
+    goom_close( p_plugin_info );
 }
 
 /*****************************************************************************
@@ -393,7 +406,7 @@ static char *TitleGet( vlc_object_t *p_this )
 
     if( p_input )
     {
-        char *psz = strrchr( p_input->psz_source, '/' );
+        char *psz = strrchr( p_input->input.p_item->psz_uri, '/' );
 
         if( psz )
         {
@@ -401,7 +414,7 @@ static char *TitleGet( vlc_object_t *p_this )
         }
         else
         {
-            psz = p_input->psz_source;
+            psz = p_input->input.p_item->psz_uri;
         }
         if( psz && *psz )
         {