[vlc-commits] Qt4: fix input item now playing

Rémi Denis-Courmont git at videolan.org
Sat Apr 30 16:24:36 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 30 17:22:31 2011 +0300| [c04d86713b570656e264648fda70fd3d2c792b9e] | committer: Rémi Denis-Courmont

Qt4: fix input item now playing

This fixes a memory leak, encoding problems, and complete failure on
non-file inputs.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c04d86713b570656e264648fda70fd3d2c792b9e
---

 modules/gui/qt4/input_manager.cpp |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 6acb687..d43c363 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -461,18 +461,23 @@ void InputManager::UpdateName()
     /* Try to get the nowplaying */
     char *format = var_InheritString( p_intf, "input-title-format" );
     char *formated = str_format_meta( p_input, format );
-    name = formated;
-    /* Free everything */
     free( format );
+    name = qfu(formated);
     free( formated );
 
     /* If we have Nothing */
     if( name.isEmpty() )
     {
-        char *psz_name = make_path( input_item_GetURI( input_GetItem( p_input ) ) );
-        name = psz_name;
-        name = name.remove( 0, name.lastIndexOf( DIR_SEP ) + 1 );
-        free( psz_name );
+        char *uri = input_item_GetURI( input_GetItem( p_input ) );
+        char *file = uri ? strrchr( uri, '/' ) : NULL;
+        if( file != NULL )
+        {
+            decode_URI( ++file );
+            name = qfu(file);
+        }
+        else
+            name = qfu(uri);
+        free( uri );
     }
 
     name = name.trimmed();



More information about the vlc-commits mailing list