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

ib subversion at mplayerhq.hu
Thu Feb 23 13:58:21 CET 2012


Author: ib
Date: Thu Feb 23 13:58:21 2012
New Revision: 34765

Log:
Revise listMgr() command PLAYLIST_ITEM_DEL_CURR.

Additionally, insert some blank lines and remove commented code.

Modified:
   trunk/gui/util/list.c

Modified: trunk/gui/util/list.c
==============================================================================
--- trunk/gui/util/list.c	Thu Feb 23 13:39:29 2012	(r34764)
+++ trunk/gui/util/list.c	Thu Feb 23 13:58:21 2012	(r34765)
@@ -103,26 +103,25 @@ void *listMgr(int cmd, void *data)
         return plCurrent;
 
     case PLAYLIST_ITEM_DEL_CURR:
-    {
-        plItem *curr = plCurrent;
 
-        if (!curr)
-            return NULL;
+        if (plCurrent) {
+        plItem *curr = plCurrent;
 
         if (curr->prev)
             curr->prev->next = curr->next;
         if (curr->next)
             curr->next->prev = curr->prev;
-        if (curr == plList)
-            plList = curr->next;
 
         plCurrent = curr->next;
 
+        if (curr == plList)
+            plList = plCurrent;
+
         free(curr->path);
         free(curr->name);
         free(curr);
     }
-        //uiCurr();     // instead of using uiNext && uiPrev
+
         return plCurrent;
 
     case PLAYLIST_DELETE:


More information about the MPlayer-cvslog mailing list