Commit 1af1638e authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx: Simplify the title update code.

parent aebbc1e7
...@@ -274,35 +274,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -274,35 +274,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
NSString * o_title = nil; NSString * o_title = nil;
NSMutableString * o_mrl = nil; NSMutableString * o_mrl = nil;
input_thread_t * p_input; input_thread_t * p_input;
char * psz_title;
if( p_vout == NULL ) if( !p_vout ) return;
{
return;
}
p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT ); p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input == NULL ) if( !p_input ) return;
{
return; input_item_t * p_item = input_GetItem( p_input );
}
psz_title = input_item_GetNowPlaying ( p_item );
if( !psz_title )
psz_title = input_item_GetName( p_item );
char *psz_nowPlaying = input_item_GetNowPlaying ( input_GetItem( p_input ) ); if( psz_title )
char *psz_name = input_item_GetName( input_GetItem( p_input ) ); o_title = [NSString stringWithUTF8String: psz_title];
char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
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 ) char *psz_uri = input_item_GetURI( p_item );
if( psz_uri )
o_mrl = [NSMutableString stringWithUTF8String: psz_uri]; o_mrl = [NSMutableString stringWithUTF8String: psz_uri];
free( psz_nowPlaying ); free( psz_title );
free( psz_name );
free( psz_uri ); free( psz_uri );
if( o_title == nil ) if( !o_title )
o_title = o_mrl; o_title = o_mrl;
if( o_mrl != nil ) if( o_mrl != nil )
......
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