changeset 35562:8b3791b648c6

Add a function to unset media information.
author ib
date Mon, 10 Dec 2012 13:57:53 +0000
parents 8889d320734f
children d4a84f674401
files gui/ui/actions.c gui/ui/actions.h
diffstat 2 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/actions.c	Mon Dec 10 13:54:56 2012 +0000
+++ b/gui/ui/actions.c	Mon Dec 10 13:57:53 2012 +0000
@@ -279,18 +279,7 @@
 
     if (type != SAME_STREAMTYPE) {
         guiInfo.StreamType = type;
-
-        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);
+        uiUnsetMedia();
     }
 }
 
@@ -303,6 +292,24 @@
 }
 
 /**
+ * @brief Unset media information.
+ */
+void uiUnsetMedia(void)
+{
+    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 Set file to be played to current playlist entry.
  */
 void uiCurr(void)
--- a/gui/ui/actions.h	Mon Dec 10 13:54:56 2012 +0000
+++ b/gui/ui/actions.h	Mon Dec 10 13:57:53 2012 +0000
@@ -31,5 +31,6 @@
 void uiSetFile(char *dir, char *name, int type);
 void uiState(void);
 void uiUnsetFile(void);
+void uiUnsetMedia(void);
 
 #endif /* MPLAYER_GUI_ACTIONS_H */