[MPlayer-cvslog] r37504 - in trunk/gui: interface.c ui/actions.c

ib subversion at mplayerhq.hu
Tue Sep 8 13:53:09 CEST 2015


Author: ib
Date: Tue Sep  8 13:53:08 2015
New Revision: 37504

Log:
Set guiInfo.Track information in uiSetFileFromPlaylist().

This is the place to do it, because the track information
changes every time uiSetFileFromPlaylist() is called.

It simplifies the code.

Modified:
   trunk/gui/interface.c
   trunk/gui/ui/actions.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Sep  8 13:39:18 2015	(r37503)
+++ trunk/gui/interface.c	Tue Sep  8 13:53:08 2015	(r37504)
@@ -600,7 +600,6 @@ int gui(int what, void *data)
             } else {
                 next = listMgr(PLAYLIST_ITEM_GET_CURR, 0);
                 uiSetFileFromPlaylist(next);
-                guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
             }
         }
         break;
@@ -1023,7 +1022,6 @@ int gui(int what, void *data)
         if (next) {
             uiSetFileFromPlaylist(next);
             guiInfo.MediumChanged = GUI_MEDIUM_NEW;
-            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
         } else {
             if (guiInfo.MediumChanged == GUI_MEDIUM_NEW)
                 break;

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Tue Sep  8 13:39:18 2015	(r37503)
+++ trunk/gui/ui/actions.c	Tue Sep  8 13:53:08 2015	(r37504)
@@ -726,6 +726,7 @@ void uiSetFileFromPlaylist(plItem *item)
     guiInfo.Start = item->start;
     guiInfo.Stop  = item->stop;
     guiInfo.Title = gstrdup(item->title);
+    guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, item);
 }
 
 /**
@@ -820,7 +821,6 @@ void uiCurr(void)
         if (curr) {
             uiSetFileFromPlaylist(curr);
             guiInfo.PlaylistNext = False;
-            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, curr);
             break;
         }
 
@@ -899,7 +899,6 @@ void uiPrev(void)
         if (prev) {
             uiSetFileFromPlaylist(prev);
             guiInfo.PlaylistNext = !guiInfo.Playing;
-            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, prev);
             break;
         }
 
@@ -968,7 +967,6 @@ void uiNext(void)
         if (next) {
             uiSetFileFromPlaylist(next);
             guiInfo.PlaylistNext = !guiInfo.Playing;
-            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
             break;
         }
 


More information about the MPlayer-cvslog mailing list