Commit 8be68853 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: if an input item includes a NowPlaying meta item, display it in our...

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
parent 192a2076
...@@ -1328,6 +1328,10 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1328,6 +1328,10 @@ static VLCMain *_o_sharedMainInstance = nil;
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
return; return;
} }
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: o_temp = [NSString stringWithUTF8String:
p_playlist->status.p_item->p_input->psz_name]; p_playlist->status.p_item->p_input->psz_name];
[self setScrollField: o_temp stopAfter:-1]; [self setScrollField: o_temp stopAfter:-1];
......
...@@ -271,7 +271,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -271,7 +271,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)updateTitle - (void)updateTitle
{ {
NSMutableString * o_title = nil, * o_mrl = nil; NSString * o_title = nil;
NSMutableString * o_mrl = nil;
input_thread_t * p_input; input_thread_t * p_input;
if( p_vout == NULL ) if( p_vout == NULL )
...@@ -286,14 +287,21 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -286,14 +287,21 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
return; return;
} }
char *psz_nowPlaying = input_item_GetNowPlaying ( input_GetItem( p_input ) );
char *psz_name = input_item_GetName( input_GetItem( p_input ) ); char *psz_name = input_item_GetName( input_GetItem( p_input ) );
char *psz_uri = input_item_GetURI( input_GetItem( p_input ) ); char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
if( psz_name != NULL ) if( psz_nowPlaying != NULL )
o_title = [NSMutableString stringWithUTF8String: psz_name]; o_title = [NSString stringWithUTF8String: psz_nowPlaying];
else if( psz_name != NULL )
o_title = [NSString stringWithUTF8String: psz_name];
if( psz_uri != NULL ) if( psz_uri != NULL )
o_mrl = [NSMutableString stringWithUTF8String: psz_uri]; 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 ) if( o_title == nil )
o_title = o_mrl; o_title = o_mrl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment