]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlist.m
Input access locking, part 3 (final).
[vlc] / modules / gui / macosx / playlist.m
index 85cff494182f6cd3e510a4b47de919972fbbc78d..115d3232d3368748787ba8d1abd42d1a174426fb 100644 (file)
     {
         /* sanity check to prevent the NSString class from crashing */
         char *psz_title =  input_item_GetTitle( p_item->p_input );
-        if( !EMPTY_STR( psz_title ) ) )
+        if( !EMPTY_STR( psz_title ) )
         {
-            o_value = [NSString stringWithUTF8String: psz_title )];
+            o_value = [NSString stringWithUTF8String: psz_title];
             if( o_value == NULL )
-                o_value = [NSString stringWithCString: psz_title )];
+                o_value = [NSString stringWithCString: psz_title];
         } 
         else
         {
                 if( o_value == NULL )
                     o_value = [NSString stringWithCString: psz_name];
             }
+            free( psz_name );
         }
         free( psz_title );
-        free( psz_name );
     }
     else
     {
         char *psz_artist = input_item_GetArtist( p_item->p_input );
         if( [[o_tc identifier] isEqualToString:@"2"] && !EMPTY_STR( psz_artist ) )
         {
-            o_value = [NSString stringWithUTF8String: psz_artist )];
+            o_value = [NSString stringWithUTF8String: psz_artist];
             if( o_value == NULL )
-                o_value = [NSString stringWithCString: psz_artist )];
+                o_value = [NSString stringWithCString: psz_artist];
         }
         else if( [[o_tc identifier] isEqualToString:@"3"] )
         {
             char psz_duration[MSTRTIME_MAX_SIZE];
-            mtime_t dur = p_item->p_input->i_duration;
+            mtime_t dur = input_item_GetDuration( p_item->p_input );
             if( dur != -1 )
             {
                 secstotimestr( psz_duration, dur/1000000 );
         {
             playlist_item_t *p_item;
             p_item = playlist_ItemGetByInput( p_playlist, p_input, VLC_TRUE );
-            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, NULL, p_item );
+            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, p_item );
         }
         else
         {
             playlist_item_t *p_item;
             p_item = playlist_ItemGetByInput( p_playlist, p_input, VLC_TRUE );
-            playlist_Control( p_playlist, PLAYLIST_PREPARSE, VLC_TRUE, p_item );
+            playlist_Control( p_playlist, PLAYLIST_SKIP, VLC_TRUE, p_item );
         }
     }
     [self playlistUpdated];
         {
             playlist_item_t *p_item;
             p_item = playlist_ItemGetByInput( p_playlist, p_input, VLC_TRUE );
-            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, NULL, p_item );
+            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, p_item );
         }
         else
         {
             playlist_item_t *p_item;
             p_item = playlist_ItemGetByInput( p_playlist, p_input, VLC_TRUE );
-            playlist_Control( p_playlist, PLAYLIST_PREPARSE, VLC_TRUE, p_item );
+            playlist_Control( p_playlist, PLAYLIST_SKIP, VLC_TRUE, p_item );
         }
     }
     [self playlistUpdated];