]> git.sesse.net Git - vlc/blobdiff - modules/gui/gtk/playlist.c
* ALL: removed a bunch of unused add_category_hint().
[vlc] / modules / gui / gtk / playlist.c
index 2e422aa73c5b8450092c073ef3b8738fb28867bb..33f29bc600c3780cf1ed9c5e55e54fe84ff46e81 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_playlist.c : Interface for the playlist dialog
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: playlist.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: playlist.c,v 1.9 2004/01/05 13:07:03 zorglub Exp $
  *
  * Authors: Pierre Baillet <oct@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -392,7 +392,7 @@ void GtkDropDataReceived( intf_thread_t * p_intf,
     gchar *     p_protocol;
     gchar *     p_temp;
     gchar *     p_next;
-    gchar *     p_string = p_data->data ;
+    gchar *     p_string = (gchar *)p_data->data;
     GList *     p_files = NULL;
     GtkCList *  p_clist;
 
@@ -512,7 +512,7 @@ void GtkDeleteGListItem( gpointer data, gpointer param )
 
 gint GtkCompareItems( gconstpointer a, gconstpointer b )
 {
-    return b - a;
+    return (ptrdiff_t) ( (int *)b - (int *)a );
 }
 
 
@@ -611,8 +611,8 @@ static GList * GtkReadFiles( intf_thread_t * p_intf, gchar * psz_fsname )
  */
 int GtkAppendList( playlist_t * p_playlist, int i_pos, GList * p_list )
 {
-    guint i_dummy;
-    guint i_length;
+    int i_dummy;
+    int i_length;
 
     i_length = g_list_length( p_list );
 
@@ -623,6 +623,7 @@ int GtkAppendList( playlist_t * p_playlist, int i_pos, GList * p_list )
                    the item where they are suppose to go but, hey
                    this works :P (btw, you are really nasty too) */
                g_list_nth_data( p_list, i_dummy ),
+               g_list_nth_data( p_list, i_dummy ),
                i_dummy == 0 ? PLAYLIST_INSERT | PLAYLIST_GO : PLAYLIST_INSERT,
                i_pos == PLAYLIST_END ? PLAYLIST_END : ( i_pos + i_dummy ) );
     }
@@ -694,8 +695,18 @@ void GtkRebuildCList( GtkCList * p_clist, playlist_t * p_playlist )
     vlc_mutex_lock( &p_playlist->object_lock );
     for( i_dummy = p_playlist->i_size ; i_dummy-- ; )
     {
+        char psz_duration[MSTRTIME_MAX_SIZE];
+        mtime_t dur = p_playlist->pp_items[i_dummy]->i_duration;
+        if ( dur != -1 )
+        {
+            secstotimestr( psz_duration, dur/1000000 );
+        }
+        else
+        {
+            memcpy( psz_duration ,"no info",sizeof("no info" ));
+        }
         ppsz_text[0] = p_playlist->pp_items[i_dummy]->psz_name;
-        ppsz_text[1] = "no info";
+        ppsz_text[1] = strdup( psz_duration );
         gtk_clist_insert( p_clist, 0, ppsz_text );
     }
     vlc_mutex_unlock( &p_playlist->object_lock );