From 8be68853f19e3b764cd9e416cf4bb2025729779c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Tue, 1 Jan 2008 14:48:25 +0000 Subject: [PATCH] macosx: if an input item includes a NowPlaying meta item, display it in our controller window instead some bogus MRL parsing stuff nobody can understand --- modules/gui/macosx/intf.m | 8 ++++++-- modules/gui/macosx/vout.m | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index a5209c493b..780feaa2fc 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -1328,8 +1328,12 @@ static VLCMain *_o_sharedMainInstance = nil; vlc_object_release( p_playlist ); return; } - o_temp = [NSString stringWithUTF8String: - p_playlist->status.p_item->p_input->psz_name]; + if( input_item_GetNowPlaying ( p_playlist->status.p_item->p_input ) ) + o_temp = [NSString stringWithUTF8String: + input_item_GetNowPlaying ( p_playlist->status.p_item->p_input )]; + else + o_temp = [NSString stringWithUTF8String: + p_playlist->status.p_item->p_input->psz_name]; [self setScrollField: o_temp stopAfter:-1]; [[[self getControls] getFSPanel] setStreamTitle: o_temp]; diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index f9d84bbd9b..5c87268715 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -271,7 +271,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, - (void)updateTitle { - NSMutableString * o_title = nil, * o_mrl = nil; + NSString * o_title = nil; + NSMutableString * o_mrl = nil; input_thread_t * p_input; if( p_vout == NULL ) @@ -286,14 +287,21 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, return; } + char *psz_nowPlaying = input_item_GetNowPlaying ( input_GetItem( p_input ) ); char *psz_name = input_item_GetName( input_GetItem( p_input ) ); char *psz_uri = input_item_GetURI( input_GetItem( p_input ) ); - if( psz_name != NULL ) - o_title = [NSMutableString stringWithUTF8String: psz_name]; + if( psz_nowPlaying != NULL ) + o_title = [NSString stringWithUTF8String: psz_nowPlaying]; + else if( psz_name != NULL ) + o_title = [NSString stringWithUTF8String: psz_name]; + if( psz_uri != NULL ) o_mrl = [NSMutableString stringWithUTF8String: psz_uri]; - free( psz_name ); - free( psz_uri ); + + FREENULL( psz_nowPlaying ); + FREENULL( psz_name ); + FREENULL( psz_uri ); + if( o_title == nil ) o_title = o_mrl; -- 2.20.1