]> git.sesse.net Git - vlc/commitdiff
skins2: improve short name display ($N)
authorErwan Tulou <erwan10@videolan.org>
Mon, 11 Feb 2013 16:34:57 +0000 (17:34 +0100)
committerErwan Tulou <erwan10@videolan.org>
Mon, 11 Feb 2013 16:47:51 +0000 (17:47 +0100)
This patch reuses the same algorithm to display a short name ($N) as the one
used to display the playlist.

This should fix an issue described at http://forum.videolan.org/viewtopic.php?f=15&t=108336

modules/gui/skins2/src/vlcproc.cpp

index 0900ec01835089aca70f828d4aecd32ed88410f7..6531248f97112eedb17f6e05bffa9d93a76dfc12 100644 (file)
@@ -786,16 +786,23 @@ void VlcProc::update_current_input()
     if( !pInput )
         return;
 
-    input_item_t *p_item = input_GetItem( pInput );
-    if( p_item )
+    input_item_t *pItem = input_GetItem( pInput );
+    if( pItem )
     {
         // Update short name
-        char *psz_name = input_item_GetName( p_item );
+        char *psz_name = input_item_GetTitle( pItem );
+        if( EMPTY_STR( psz_name ) )
+        {
+            free( psz_name );
+            psz_name = input_item_GetName( pItem );
+        }
+        if( !psz_name )
+            psz_name = strdup ( "" );
         SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ) );
         free( psz_name );
 
         // Update local path (if possible) or full uri
-        char *psz_uri = input_item_GetURI( p_item );
+        char *psz_uri = input_item_GetURI( pItem );
         char *psz_path = make_path( psz_uri );
         char *psz_save = psz_path ? psz_path : psz_uri;
         SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_save ) );
@@ -803,7 +810,7 @@ void VlcProc::update_current_input()
         free( psz_uri );
 
         // Update art uri
-        char *psz_art = input_item_GetArtURL( p_item );
+        char *psz_art = input_item_GetArtURL( pItem );
         SET_STRING( m_cVarStreamArt, string( psz_art ? psz_art : "" ) );
         free( psz_art );
     }