[vlc-devel] commit: macosx: Make sure there is a title or a name for the input item. ( Pierre d'Herbemont )

git version control git at videolan.org
Sun Jul 13 20:48:37 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jul 13 20:50:56 2008 +0200| [8fecaa83ebb0d4e3ecb4f684598abd8419fb3764]

macosx: Make sure there is a title or a name for the input item.

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

 modules/gui/macosx/playlistinfo.m |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/playlistinfo.m b/modules/gui/macosx/playlistinfo.m
index edc4e51..16a51c3 100644
--- a/modules/gui/macosx/playlistinfo.m
+++ b/modules/gui/macosx/playlistinfo.m
@@ -218,6 +218,7 @@ static VLCInfo *_o_sharedInstance = nil;
     if( _p_item != p_item )
     {
         if( p_item ) vlc_gc_decref( p_item );
+        [o_saveMetaData_btn setEnabled: NO];
         if( _p_item ) vlc_gc_incref( _p_item );
         p_item = _p_item;
     }
@@ -244,10 +245,6 @@ static VLCInfo *_o_sharedInstance = nil;
     }
     else
     {
-        /* fill uri info */
-        char * psz_url = input_item_GetURI( p_item );
-        [o_uri_txt setStringValue: [NSString stringWithUTF8String: psz_url ? psz_url : ""  ]];
-
         if( !input_item_IsPreparsed( p_item ) )
         {
             playlist_t * p_playlist = pl_Yield( VLCIntf );
@@ -255,15 +252,24 @@ static VLCInfo *_o_sharedInstance = nil;
             pl_Release( VLCIntf );
         }
 
+        /* fill uri info */
+        char * psz_url = input_item_GetURI( p_item );
+        [o_uri_txt setStringValue: [NSString stringWithUTF8String: psz_url ? psz_url : ""  ]];
         free( psz_url );
 
+        /* fill title info */
+        char * psz_title = input_item_GetTitle( p_item );
+        if( !psz_title )
+            psz_title = input_item_GetName( p_item );
+        [o_title_txt setStringValue: [NSString stringWithUTF8String: psz_title ? : ""  ]];
+        free( psz_title );
+
     #define SET( foo, bar ) \
         char *psz_##foo = input_item_Get##bar ( p_item ); \
         [self setMeta: psz_##foo forLabel: o_##foo##_txt]; \
         FREENULL( psz_##foo );
 
         /* fill the other fields */
-        SET( title, Title );
         SET( author, Artist );
         SET( collection, Album );
         SET( seqNum, TrackNum );




More information about the vlc-devel mailing list