[MPlayer-cvslog] r35581 - trunk/gui/util/list.c

ib subversion at mplayerhq.hu
Mon Dec 3 15:43:42 CET 2012


Author: ib
Date: Mon Dec  3 15:43:42 2012
New Revision: 35581

Log:
Enhance PLAYLIST_ITEM_GET_POS to provide total number of items.

Modified:
   trunk/gui/util/list.c

Modified: trunk/gui/util/list.c
==============================================================================
--- trunk/gui/util/list.c	Mon Dec  3 15:40:20 2012	(r35580)
+++ trunk/gui/util/list.c	Mon Dec  3 15:43:42 2012	(r35581)
@@ -45,7 +45,8 @@ static urlItem *urlList;
  *         pointer to current list item (ITEM command) or
  *         NULL (DELETE or unknown command)
  *
- * @note PLAYLIST_ITEM_GET_POS returns the position number as pointer,
+ * @note PLAYLIST_ITEM_GET_POS returns the position number as pointer
+ *       (if @a data is NULL the last position number, i.e. number of items),
  *       and position 0 means "not found"
  */
 void *listMgr(int cmd, void *data)
@@ -138,6 +139,9 @@ void *listMgr(int cmd, void *data)
 
                 item = item->next;
             } while (item);
+
+            if (!pdat)
+                pos = i;
         }
 
         return (void *)pos;


More information about the MPlayer-cvslog mailing list