]> git.sesse.net Git - vlc/blobdiff - modules/visualization/goom.c
Input access locking, part 3 (final).
[vlc] / modules / visualization / goom.c
index 06481d7ca6dc2ea8d2af4873ccbc3c911024ac6d..3d8c7f67520b8de57cd94f1ab0ef7f2ed0f0b822 100644 (file)
@@ -25,8 +25,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>                                              /* strdup() */
 #include <errno.h>
 
 #include <vlc/vlc.h>
@@ -416,13 +414,12 @@ static char *TitleGet( vlc_object_t *p_this )
 
     if( p_input )
     {
-        if( !EMPTY_STR( input_item_GetTitle( input_GetItem(p_input) ) ) )
+        psz_title = input_item_GetTitle( input_GetItem( p_input ) );
+        if( EMPTY_STR( psz_title ) )
         {
-            psz_title = strdup( input_item_GetTitle( input_GetItem(p_input) ) );
-        }
-        else
-        {
-            char *psz = strrchr( input_GetItem(p_input)->psz_uri, '/' );
+            free( psz_title );
+            char *psz_orig = input_item_GetURI( input_GetItem( p_input ) );
+            char *psz = strrchr( psz_orig, '/' );
 
             if( psz )
             {
@@ -430,12 +427,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 );
     }