[vlc-commits] skins2: improve short name display ($N)
Erwan Tulou
git at videolan.org
Mon Feb 11 17:50:29 CET 2013
vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Mon Feb 11 17:34:57 2013 +0100| [8849094710a60b115131501a62692016901a9453] | committer: Erwan Tulou
skins2: improve short name display ($N)
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
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8849094710a60b115131501a62692016901a9453
---
modules/gui/skins2/src/vlcproc.cpp | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 0900ec0..6531248 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -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 );
}
More information about the vlc-commits
mailing list