]> git.sesse.net Git - vlc/blobdiff - modules/visualization/goom.c
Check-in modules/Makefile.am
[vlc] / modules / visualization / goom.c
index 8547518a0dd14db21f91575ca82884025aef6ad0..043b37e90e01dfeb44ac0735415b79404951c4c6 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <string.h>                                              /* strdup() */
 #include <errno.h>
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_aout.h>
 #include <vlc_vout.h>
@@ -174,7 +177,7 @@ static int Open( vlc_object_t *p_this )
     {
         msg_Err( p_filter, "no suitable vout module" );
         vlc_object_detach( p_thread );
-        vlc_object_destroy( p_thread );
+        vlc_object_release( p_thread );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -195,9 +198,9 @@ static int Open( vlc_object_t *p_this )
         vout_Destroy( p_thread->p_vout );
         vlc_mutex_destroy( &p_thread->lock );
         vlc_cond_destroy( &p_thread->wait );
-        if( p_thread->psz_title ) free( p_thread->psz_title );
+        free( p_thread->psz_title );
         vlc_object_detach( p_thread );
-        vlc_object_destroy( p_thread );
+        vlc_object_release( p_thread );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -213,6 +216,8 @@ static int Open( vlc_object_t *p_this )
 static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
                     aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
 {
+    VLC_UNUSED( p_aout );
+
     aout_filter_sys_t *p_sys = p_filter->p_sys;
     block_t *p_block;
 
@@ -351,11 +356,8 @@ static void Thread( vlc_object_t *p_this )
         plane = goom_update( p_plugin_info, p_data, 0, 0.0,
                              p_thread->psz_title, NULL );
 
-        if( p_thread->psz_title )
-        {
-            free( p_thread->psz_title );
-            p_thread->psz_title = NULL;
-        }
+        free( p_thread->psz_title );
+        p_thread->psz_title = NULL;
 
         while( !( p_pic = vout_CreatePicture( p_thread->p_vout, 0, 0, 0 ) ) &&
                !p_thread->b_die )
@@ -402,7 +404,7 @@ static void Close( vlc_object_t *p_this )
         block_Release( p_sys->p_thread->pp_blocks[p_sys->p_thread->i_blocks] );
     }
 
-    vlc_object_destroy( p_sys->p_thread );
+    vlc_object_release( p_sys->p_thread );
 
     free( p_sys );
 }
@@ -415,11 +417,12 @@ static char *TitleGet( vlc_object_t *p_this )
 
     if( p_input )
     {
-        psz_title = strdup( input_item_GetTitle( input_GetItem( p_input ) ) );
+        psz_title = input_item_GetTitle( input_GetItem( p_input ) );
         if( EMPTY_STR( psz_title ) )
         {
             free( psz_title );
-            char *psz = strrchr( input_GetItem(p_input)->psz_uri, '/' );
+            char *psz_orig = input_item_GetURI( input_GetItem( p_input ) );
+            char *psz = strrchr( psz_orig, '/' );
 
             if( psz )
             {
@@ -427,12 +430,13 @@ static char *TitleGet( vlc_object_t *p_this )
             }
             else
             {
-                psz = input_GetItem(p_input)->psz_uri;
+                psz = psz_orig;
             }
             if( psz && *psz )
             {
                 psz_title = strdup( psz );
             }
+            free( psz_orig );
         }
         vlc_object_release( p_input );
     }