changeset 35568:9f58ee705989

Add a parameter to uiUnsetMedia(). This is to control guiInfo data for STREAMTYPE_DVD.
author ib
date Tue, 11 Dec 2012 13:40:47 +0000
parents 9ffbffc4216c
children 8381468bb46c
files gui/interface.c gui/ui/actions.c gui/ui/actions.h
diffstat 3 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Tue Dec 11 12:43:00 2012 +0000
+++ b/gui/interface.c	Tue Dec 11 13:40:47 2012 +0000
@@ -850,7 +850,7 @@
                 int first = (guiInfo.StreamType == STREAMTYPE_VCD ? 2 : 1);
 
                 if (guiInfo.Track != first) {
-                    uiUnsetMedia();
+                    uiUnsetMedia(True);
                     guiInfo.Track = first;
                 }
 
--- a/gui/ui/actions.c	Tue Dec 11 12:43:00 2012 +0000
+++ b/gui/ui/actions.c	Tue Dec 11 13:40:47 2012 +0000
@@ -279,7 +279,7 @@
 
     if (type != SAME_STREAMTYPE) {
         guiInfo.StreamType = type;
-        uiUnsetMedia();
+        uiUnsetMedia(False);
     }
 }
 
@@ -293,16 +293,25 @@
 
 /**
  * @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);
--- a/gui/ui/actions.h	Tue Dec 11 12:43:00 2012 +0000
+++ b/gui/ui/actions.h	Tue Dec 11 13:40:47 2012 +0000
@@ -31,6 +31,6 @@
 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 */