macosx: if an input item includes a NowPlaying meta item, display it in our controlle...
authorFelix Paul Kühne <fkuehne@videolan.org>
Tue, 1 Jan 2008 14:48:25 +0000 (14:48 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Tue, 1 Jan 2008 14:48:25 +0000 (14:48 +0000)
modules/gui/macosx/intf.m
modules/gui/macosx/vout.m

index a5209c4..780feaa 100644 (file)
@@ -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];
 
index f9d84bb..5c87268 100644 (file)
@@ -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;