]> git.sesse.net Git - vlc/commitdiff
macosx: Make sure there is a title or a name for the input item.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 13 Jul 2008 18:50:56 +0000 (20:50 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 13 Jul 2008 18:50:56 +0000 (20:50 +0200)
modules/gui/macosx/playlistinfo.m

index edc4e5150a769cd2793f9957e01657af19635656..16a51c3350d643c436c4d151c84925b9c93af400 100644 (file)
@@ -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 );