diff gui/ui/actions.c @ 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 8b3791b648c6
children 8381468bb46c
line wrap: on
line diff
--- 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);