From: Pierre d'Herbemont Date: Sun, 13 Jul 2008 18:50:56 +0000 (+0200) Subject: macosx: Make sure there is a title or a name for the input item. X-Git-Tag: 0.9.0-test2~16 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=8fecaa83ebb0d4e3ecb4f684598abd8419fb3764 macosx: Make sure there is a title or a name for the input item. --- diff --git a/modules/gui/macosx/playlistinfo.m b/modules/gui/macosx/playlistinfo.m index edc4e5150a..16a51c3350 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 );