changeset 34057:418e04046d98

Fix Win32 GUI filename problems. guiInfo.Filename wasn't properly set. It must be allocated and filename must point to it. Reported by Stephen Sheldon, sfsheldo gmail com.
author ib
date Wed, 28 Sep 2011 16:17:35 +0000
parents 792c1e241416
children 19e2b5682587
files gui/win32/interface.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/win32/interface.c	Wed Sep 28 13:53:15 2011 +0000
+++ b/gui/win32/interface.c	Wed Sep 28 16:17:35 2011 +0000
@@ -455,7 +455,7 @@
             dvd_title = 0;
             force_fps = 0;
             if(!mygui->playlist->tracks) return 0;
-            filename = guiInfo.Filename = mygui->playlist->tracks[mygui->playlist->current]->filename;
+            setdup(&guiInfo.Filename, mygui->playlist->tracks[mygui->playlist->current]->filename);
             guiInfo.Track = mygui->playlist->current + 1;
             if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm");
             if(gtkAOExtraStereo)
@@ -486,10 +486,7 @@
                 }
 #endif
             }
-            if(guiInfo.Filename)
-                filename = strdup(guiInfo.Filename);
-            else if(filename)
-                strcpy(guiInfo.Filename, filename);
+            filename = guiInfo.Filename;
             break;
         }
         case GUI_SET_AUDIO:
@@ -741,6 +738,7 @@
     {
         mygui->playlist->current = 0;
         filename = mygui->playlist->tracks[0]->filename;
+        uiSetFileName(NULL, filename, STREAMTYPE_FILE);
     }
     return result;
 }