[MPlayer-cvslog] r35666 - trunk/gui/dialog/playlist.c

ib subversion at mplayerhq.hu
Tue Dec 11 15:51:17 CET 2012


Author: ib
Date: Tue Dec 11 15:51:17 2012
New Revision: 35666

Log:
While playing, allow extensive editing of the playlist without stopping.

If the current file is still present in the list after editing, playback
of the file (at adjusted position) seamlessly continues. Otherwise, or
during stop mode, playback starts with track 1 again - automatically in
playing mode, to be restarted by the user in stop mode.

Based on a patch by Hans-Dieter Kosch, hdkosch kabelbw de.

Modified:
   trunk/gui/dialog/playlist.c

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Tue Dec 11 14:48:19 2012	(r35665)
+++ trunk/gui/dialog/playlist.c	Tue Dec 11 15:51:17 2012	(r35666)
@@ -194,14 +194,13 @@ static void plButtonReleased( GtkButton 
  {
   case 1: // ok
        {
-	int pos = 0, i;
+	int i;
 	plItem curr, * item, * old;
 	item = listMgr( PLAYLIST_ITEM_GET_CURR,0 );
 	if (item)
 	 {
 	  curr.path = gstrdup(item->path);
 	  curr.name = gstrdup(item->name);
-	  pos = (int) listMgr( PLAYLIST_ITEM_GET_POS,item );
 	 }
 	else curr.path = curr.name = NULL;
 	listMgr( PLAYLIST_DELETE,0 );
@@ -220,12 +219,13 @@ static void plButtonReleased( GtkButton 
 	item = listMgr( PLAYLIST_GET,0 );
 	if ( item )
 	 {
-	  if ( guiInfo.Playing && curr.name && pos )
+	  if ( guiInfo.Playing && curr.name )
 	   {
 	    old = listMgr( PLAYLIST_ITEM_FIND,&curr );
-	    if ( old &&  ( pos == (int) listMgr( PLAYLIST_ITEM_GET_POS,old ) ) )
+	    if ( old )
 	     {
 	      listMgr( PLAYLIST_ITEM_SET_CURR,old );
+	      guiInfo.Track = (int) listMgr( PLAYLIST_ITEM_GET_POS,old );
 	      item = NULL;
 	     }
 	   }


More information about the MPlayer-cvslog mailing list