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

ib subversion at mplayerhq.hu
Thu Apr 12 15:40:54 EEST 2018


Author: ib
Date: Thu Apr 12 15:40:54 2018
New Revision: 38070

Log:
Make guiInfo.SubtitleFilename available as long as the video plays.

Don't clear guiInfo.SubtitleFilename with uiUnsetMedia(FALSE),
because media is unset (i.e. prepared) this way whenever a new
file will be loaded for playback which happens *after* loading
a separate subtitle.

So explicitly clear guiInfo.SubtitleFilename only by a full unset
(uiUnsetMedia(TRUE)) and regularly unset it after a playback has
ended (at GUI_END_PLAY).

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

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Thu Apr 12 15:23:53 2018	(r38069)
+++ trunk/gui/interface.c	Thu Apr 12 15:40:54 2018	(r38070)
@@ -1038,6 +1038,7 @@ int gui(int what, void *data)
         guiInfo.sh_video = NULL;
 
         nfree(guiInfo.AudioFilename);
+        nfree(guiInfo.SubtitleFilename);
 
         if (guiInfo.LastVolume >= 0.0f) {
             if (guiInfo.Volume == guiInfo.ReplayGainVolume)

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Thu Apr 12 15:23:53 2018	(r38069)
+++ trunk/gui/ui/actions.c	Thu Apr 12 15:40:54 2018	(r38070)
@@ -765,7 +765,7 @@ void uiUnsetFile(void)
  * @brief Unset media information.
  *
  * @param totals whether to additionally unset number of chapters, angles and
- *               audio filename (#True)
+ *               audio and subtitle filenames (#True)
  *               or just track, chapter and angle (#False)
  */
 void uiUnsetMedia(int totals)
@@ -785,6 +785,7 @@ void uiUnsetMedia(int totals)
             guiInfo.Angles = 0;
 
         nfree(guiInfo.AudioFilename);
+        nfree(guiInfo.SubtitleFilename);
     } else {
         guiInfo.Track   = 0;
         guiInfo.Chapter = 0;
@@ -793,7 +794,6 @@ void uiUnsetMedia(int totals)
 
     nfree(guiInfo.CodecName);
     nfree(guiInfo.Title);
-    nfree(guiInfo.SubtitleFilename);
     nfree(guiInfo.ImageFilename);
 }
 


More information about the MPlayer-cvslog mailing list