Commit 63e019d5 authored by Jérome Decoodt's avatar Jérome Decoodt

We use setRepresentedFilename if access is File.

Title is found in input instead of playlist (fix a small vlm bug...).
parent dffc2430
...@@ -416,35 +416,43 @@ ...@@ -416,35 +416,43 @@
- (void)updateTitle - (void)updateTitle
{ {
NSMutableString * o_title; NSMutableString * o_title,* o_mrl;
playlist_t * p_playlist; vlc_bool_t b_file = VLC_FALSE;
input_thread_t * p_input;
if( p_vout == NULL ) if( p_vout == NULL )
{ {
return; return;
} }
p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT,
FIND_ANYWHERE ); FIND_PARENT );
if( p_playlist == NULL ) if( p_input == NULL )
{ {
return; return;
} }
vlc_mutex_lock( &p_playlist->object_lock ); if( ! strcmp( p_input->input.p_access->p_module->psz_shortname, "File" ) )
b_file = VLC_TRUE;
if( p_input->input.p_item->psz_name != NULL )
o_title = [NSMutableString stringWithUTF8String: o_title = [NSMutableString stringWithUTF8String:
p_playlist->status.p_item->input.psz_uri]; p_input->input.p_item->psz_name];
vlc_mutex_unlock( &p_playlist->object_lock ); if( p_input->input.p_item->psz_uri != NULL )
vlc_object_release( p_playlist ); o_mrl = [NSMutableString stringWithUTF8String:
p_input->input.p_item->psz_uri];
if( o_title == nil )
o_title = o_mrl;
if( o_title != nil ) vlc_object_release( p_input );
if( o_mrl != nil )
{ {
NSRange prefix_range = [o_title rangeOfString: @"file:"]; if( b_file == VLC_TRUE )
if( prefix_range.location != NSNotFound )
{ {
[o_title deleteCharactersInRange: prefix_range]; NSRange prefix_range = [o_mrl rangeOfString: @"file:"];
[self setTitleWithRepresentedFilename: o_title]; if( prefix_range.location != NSNotFound )
[o_mrl deleteCharactersInRange: prefix_range];
[self setRepresentedFilename: o_mrl];
} }
[self setTitle: o_title]; [self setTitle: o_title];
} }
......
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