changeset 34064:54becc464788

Set MPlayer filename in uiSetFileName(). This ensures that filename always points to guiInfo.Filename (the GUI filename). If guiInit() is called without filename being set, leave it that way. (This applies if the GUI should not start playing immediately.)
author ib
date Thu, 29 Sep 2011 13:26:32 +0000
parents 31fdbcd6de70
children 8a7056729022
files gui/interface.c gui/ui/actions.c gui/win32/interface.c
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Thu Sep 29 11:19:23 2011 +0000
+++ b/gui/interface.c	Thu Sep 29 13:26:32 2011 +0000
@@ -233,8 +233,10 @@
 
     uiSubRender = 1;
 
-    if (plCurrent && !filename)
+    if (plCurrent && !filename) {
         uiSetFileName(plCurrent->path, plCurrent->name, STREAMTYPE_FILE);
+        filename = NULL; // don't start playing
+    }
 
     if (subdata)
         setdup(&guiInfo.SubtitleFilename, subdata->filename);
--- a/gui/ui/actions.c	Thu Sep 29 11:19:23 2011 +0000
+++ b/gui/ui/actions.c	Thu Sep 29 13:26:32 2011 +0000
@@ -229,7 +229,9 @@
     else
         setddup(&guiInfo.Filename, dir, name);
 
+    filename = guiInfo.Filename;
     guiInfo.StreamType = type;
+
     nfree(guiInfo.AudioFilename);
     nfree(guiInfo.SubtitleFilename);
 }
--- a/gui/win32/interface.c	Thu Sep 29 11:19:23 2011 +0000
+++ b/gui/win32/interface.c	Thu Sep 29 13:26:32 2011 +0000
@@ -340,7 +340,9 @@
     else
         setddup(&guiInfo.Filename, dir, name);
 
+    filename = guiInfo.Filename;
     guiInfo.StreamType = type;
+
     nfree(guiInfo.AudioFilename);
     nfree(guiInfo.SubtitleFilename);
 }