changeset 34065:8a7056729022

Change guiInfo.Filename by using uiSetFileName() only. The two nfree() may be omitted, because they are performed in uiSetFileName().
author ib
date Thu, 29 Sep 2011 13:35:31 +0000
parents 54becc464788
children 1b60a54bbfb8
files gui/interface.c gui/ui/gtk/fileselect.c gui/win32/interface.c
diffstat 3 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Thu Sep 29 13:26:32 2011 +0000
+++ b/gui/interface.c	Thu Sep 29 13:35:31 2011 +0000
@@ -406,7 +406,7 @@
             char tmp[512];
 
             sprintf(tmp, "vcd://%d", guiInfo.Track);
-            setdup(&guiInfo.Filename, tmp);
+            uiSetFileName(NULL, tmp, STREAMTYPE_VCD);
         }
         break;
 #endif
@@ -417,7 +417,7 @@
             char tmp[512];
 
             sprintf(tmp, "dvd://%d", guiInfo.Track);
-            setdup(&guiInfo.Filename, tmp);
+            uiSetFileName(NULL, tmp, STREAMTYPE_DVD);
         }
 
             dvd_chapter = guiInfo.Chapter;
@@ -768,11 +768,8 @@
 
         if (guiInfo.Playing && (next = listSet(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) {
             plLastPlayed = next;
-            setddup(&guiInfo.Filename, next->path, next->name);
-            guiInfo.StreamType = STREAMTYPE_FILE;
+            uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
             guiInfo.NewPlay    = GUI_FILE_NEW;
-            nfree(guiInfo.AudioFilename);
-            nfree(guiInfo.SubtitleFilename);
             guiInfo.Track++;
         } else {
             if (guiInfo.NewPlay == GUI_FILE_NEW)
--- a/gui/ui/gtk/fileselect.c	Thu Sep 29 13:26:32 2011 +0000
+++ b/gui/ui/gtk/fileselect.c	Thu Sep 29 13:35:31 2011 +0000
@@ -489,11 +489,8 @@
  switch ( fsType )
   {
    case fsVideoSelector:
-          setddup( &guiInfo.Filename,fsSelectedDirectory,fsSelectedFile );
-          guiInfo.StreamType=STREAMTYPE_FILE;
+          uiSetFileName( fsSelectedDirectory,fsSelectedFile,STREAMTYPE_FILE );
           guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0;
-	  nfree( guiInfo.AudioFilename );
-	  nfree( guiInfo.SubtitleFilename );
           fs_PersistantHistory( get_current_dir_name_utf8() );      //totem, write into history
           break;
    case fsSubtitleSelector:
--- a/gui/win32/interface.c	Thu Sep 29 13:26:32 2011 +0000
+++ b/gui/win32/interface.c	Thu Sep 29 13:35:31 2011 +0000
@@ -457,7 +457,7 @@
             dvd_title = 0;
             force_fps = 0;
             if(!mygui->playlist->tracks) return 0;
-            setdup(&guiInfo.Filename, mygui->playlist->tracks[mygui->playlist->current]->filename);
+            uiSetFileName(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, STREAMTYPE_FILE);
             guiInfo.Track = mygui->playlist->current + 1;
             if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm");
             if(gtkAOExtraStereo)
@@ -483,7 +483,7 @@
                     dvd_chapter = guiInfo.Chapter;
                     dvd_angle = guiInfo.Angle;
                     sprintf(tmp,"dvd://%d", guiInfo.Track);
-                    setdup(&guiInfo.Filename, tmp);
+                    uiSetFileName(NULL, tmp, STREAMTYPE_DVD);
                     break;
                 }
 #endif