[MPlayer-cvslog] r35577 - in trunk/gui/ui: actions.c gtk/playlist.c

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


Author: ib
Date: Mon Dec  3 15:04:43 2012
New Revision: 35577

Log:
Clear information associated with a file when setting a new one.

This fixes showing wrong information when jumping through the
playlist tracks in stop mode.

Modified:
   trunk/gui/ui/actions.c
   trunk/gui/ui/gtk/playlist.c

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Mon Dec  3 12:50:59 2012	(r35576)
+++ trunk/gui/ui/actions.c	Mon Dec  3 15:04:43 2012	(r35577)
@@ -265,6 +265,8 @@ void uiChangeSkin(char *name)
  * @param dir directory (optional, else NULL)
  * @param name filename
  * @param type stream type of the file
+ *
+ * @note All #guiInfo members associated with the file will be cleared.
  */
 void uiSetFile(char *dir, char *name, int type)
 {
@@ -275,31 +277,29 @@ void uiSetFile(char *dir, char *name, in
 
     filename = guiInfo.Filename;
 
-    if (type != SAME_STREAMTYPE)
+    if (type != SAME_STREAMTYPE) {
         guiInfo.StreamType = type;
 
-    nfree(guiInfo.AudioFilename);
-    nfree(guiInfo.SubtitleFilename);
+        guiInfo.VideoWidth    = 0;
+        guiInfo.VideoHeight   = 0;
+        guiInfo.AudioChannels = 0;
+        guiInfo.RunningTime   = 0;
+        guiInfo.Track   = 0;
+        guiInfo.Chapter = 0;
+        guiInfo.Angle   = 0;
+
+        nfree(guiInfo.CodecName);
+        nfree(guiInfo.AudioFilename);
+        nfree(guiInfo.SubtitleFilename);
+    }
 }
 
 /**
  * @brief Unset the file being played.
- *
- * @note Additionally, clear all #guiInfo members associated with the file.
  */
 void uiUnsetFile(void)
 {
     uiSetFile(NULL, NULL, STREAMTYPE_DUMMY);
-
-    nfree(guiInfo.CodecName);
-
-    guiInfo.Track         = 0;
-    guiInfo.Chapter       = 0;
-    guiInfo.Angle         = 0;
-    guiInfo.RunningTime   = 0;
-    guiInfo.AudioChannels = 0;
-    guiInfo.VideoWidth    = 0;
-    guiInfo.VideoHeight   = 0;
 }
 
 /**

Modified: trunk/gui/ui/gtk/playlist.c
==============================================================================
--- trunk/gui/ui/gtk/playlist.c	Mon Dec  3 12:50:59 2012	(r35576)
+++ trunk/gui/ui/gtk/playlist.c	Mon Dec  3 15:04:43 2012	(r35577)
@@ -231,7 +231,6 @@ static void plButtonReleased( GtkButton 
 	   }
 	  if ( item )
 	   {
-	    uiUnsetFile();
 	    uiSetFile( item->path,item->name,STREAMTYPE_FILE );
 	    guiInfo.NewPlay = GUI_FILE_NEW;
 	    guiInfo.PlaylistNext = (curr.name ? 0 : 1);


More information about the MPlayer-cvslog mailing list