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

ib subversion at mplayerhq.hu
Tue Dec 11 14:40:47 CET 2012


Author: ib
Date: Tue Dec 11 14:40:47 2012
New Revision: 35662

Log:
Add a parameter to uiUnsetMedia().

This is to control guiInfo data for STREAMTYPE_DVD.

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

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Dec 11 13:43:00 2012	(r35661)
+++ trunk/gui/interface.c	Tue Dec 11 14:40:47 2012	(r35662)
@@ -850,7 +850,7 @@ int gui(int what, void *data)
                 int first = (guiInfo.StreamType == STREAMTYPE_VCD ? 2 : 1);
 
                 if (guiInfo.Track != first) {
-                    uiUnsetMedia();
+                    uiUnsetMedia(True);
                     guiInfo.Track = first;
                 }
 

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Tue Dec 11 13:43:00 2012	(r35661)
+++ trunk/gui/ui/actions.c	Tue Dec 11 14:40:47 2012	(r35662)
@@ -279,7 +279,7 @@ void uiSetFile(char *dir, char *name, in
 
     if (type != SAME_STREAMTYPE) {
         guiInfo.StreamType = type;
-        uiUnsetMedia();
+        uiUnsetMedia(False);
     }
 }
 
@@ -293,16 +293,25 @@ void uiUnsetFile(void)
 
 /**
  * @brief Unset media information.
+ *
+ * @param totals whether to unset number of chapters and angles (#True) or
+ *               just track, chapter and angle (#False) as well
  */
-void uiUnsetMedia(void)
+void uiUnsetMedia(int totals)
 {
     guiInfo.VideoWidth    = 0;
     guiInfo.VideoHeight   = 0;
     guiInfo.AudioChannels = 0;
     guiInfo.RunningTime   = 0;
+
+    if (totals) {
+        guiInfo.Chapters = 0;
+        guiInfo.Angles   = 0;
+    } else {
     guiInfo.Track   = 0;
     guiInfo.Chapter = 0;
     guiInfo.Angle   = 0;
+    }
 
     nfree(guiInfo.CodecName);
     nfree(guiInfo.AudioFilename);

Modified: trunk/gui/ui/actions.h
==============================================================================
--- trunk/gui/ui/actions.h	Tue Dec 11 13:43:00 2012	(r35661)
+++ trunk/gui/ui/actions.h	Tue Dec 11 14:40:47 2012	(r35662)
@@ -31,6 +31,6 @@ void uiRelSeek(float percent);
 void uiSetFile(char *dir, char *name, int type);
 void uiState(void);
 void uiUnsetFile(void);
-void uiUnsetMedia(void);
+void uiUnsetMedia(int totals);
 
 #endif /* MPLAYER_GUI_ACTIONS_H */


More information about the MPlayer-cvslog mailing list