]> git.sesse.net Git - vlc/blobdiff - modules/visualization/goom.c
Merge branch 'master' of git://git.videolan.org/vlc
[vlc] / modules / visualization / goom.c
index 26d9a9d8b1c9f5564a8a544b5a7ca92386d1630c..427bb75d02b8d4db7e58eb6fc7ea97dfeb370bd9 100644 (file)
@@ -25,8 +25,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -38,6 +36,7 @@
 #include <vlc_block.h>
 #include <vlc_input.h>
 #include <vlc_filter.h>
+#include <vlc_playlist.h>
 
 #ifdef USE_GOOM_TREE
 #   ifdef OLD_GOOM
@@ -167,14 +166,12 @@ static int Open( vlc_object_t *p_this )
     fmt.i_width = fmt.i_visible_width = width;
     fmt.i_height = fmt.i_visible_height = height;
     fmt.i_chroma = VLC_CODEC_RGB32;
-    fmt.i_aspect = VOUT_ASPECT_FACTOR * width/height;
     fmt.i_sar_num = fmt.i_sar_den = 1;
 
     p_thread->p_vout = aout_filter_RequestVout( p_filter, NULL, &fmt );
     if( p_thread->p_vout == NULL )
     {
         msg_Err( p_filter, "no suitable vout module" );
-        vlc_object_detach( p_thread );
         vlc_object_release( p_thread );
         free( p_sys );
         return VLC_EGENERIC;
@@ -197,7 +194,6 @@ static int Open( vlc_object_t *p_this )
         vlc_mutex_destroy( &p_thread->lock );
         vlc_cond_destroy( &p_thread->wait );
         free( p_thread->psz_title );
-        vlc_object_detach( p_thread );
         vlc_object_release( p_thread );
         free( p_sys );
         return VLC_EGENERIC;
@@ -357,7 +353,7 @@ static void* Thread( vlc_object_t *p_this )
         free( p_thread->psz_title );
         p_thread->psz_title = NULL;
 
-        while( !( p_pic = vout_CreatePicture( p_thread->p_vout, 0, 0, 0 ) ) &&
+        while( !( p_pic = vout_GetPicture( p_thread->p_vout ) ) &&
                vlc_object_alive (p_thread) )
         {
             msleep( VOUT_OUTMEM_SLEEP );
@@ -368,7 +364,7 @@ static void* Thread( vlc_object_t *p_this )
         memcpy( p_pic->p[0].p_pixels, plane, width * height * 4 );
 
         p_pic->date = date_Get( &i_pts ) + GOOM_DELAY;
-        vout_DisplayPicture( p_thread->p_vout, p_pic );
+        vout_PutPicture( p_thread->p_vout, p_pic );
     }
 
     goom_close( p_plugin_info );
@@ -397,7 +393,6 @@ static void Close( vlc_object_t *p_this )
     aout_filter_RequestVout( p_filter, p_sys->p_thread->p_vout, 0 );
     vlc_mutex_destroy( &p_sys->p_thread->lock );
     vlc_cond_destroy( &p_sys->p_thread->wait );
-    vlc_object_detach( p_sys->p_thread );
 
     while( p_sys->p_thread->i_blocks-- )
     {
@@ -411,35 +406,25 @@ static void Close( vlc_object_t *p_this )
 
 static char *TitleGet( vlc_object_t *p_this )
 {
-    char *psz_title = NULL;
-    input_thread_t *p_input =
-        vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_ANYWHERE );
+    input_thread_t *p_input = playlist_CurrentInput( pl_Get( p_this ) );
+    if( !p_input )
+        return NULL;
 
-    if( p_input )
+    char *psz_title = input_item_GetTitle( input_GetItem( p_input ) );
+    if( EMPTY_STR( psz_title ) )
     {
-        psz_title = input_item_GetTitle( input_GetItem( p_input ) );
-        if( EMPTY_STR( psz_title ) )
+        free( psz_title );
+
+        char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
+        const char *psz = strrchr( psz_uri, '/' );
+        if( psz )
         {
-            free( psz_title );
-            char *psz_orig = input_item_GetURI( input_GetItem( p_input ) );
-            char *psz = strrchr( psz_orig, '/' );
-
-            if( psz )
-            {
-                psz++;
-            }
-            else
-            {
-                psz = psz_orig;
-            }
-            if( psz && *psz )
-            {
-                psz_title = strdup( psz );
-            }
-            free( psz_orig );
+            psz_title = strdup( psz + 1 );
+            free( psz_uri );
         }
-        vlc_object_release( p_input );
+        else
+            psz_title = psz_uri;
     }
-
+    vlc_object_release( p_input );
     return psz_title;
 }