Convert subtitle file name in the Win32 GUI Wine build.
authorib <ib@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 13 Apr 2018 10:44:31 +0000 (10:44 +0000)
committerib <ib@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 13 Apr 2018 10:44:31 +0000 (10:44 +0000)
The Windows style subtitle file name needs to be converted,
so that it can be found in the Linux filesystem.

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@38085 b3059339-0415-0410-9bf9-f77b7e298cf2

gui/win32/dialogs.c

index cd58332..3a61112 100644 (file)
@@ -73,6 +73,13 @@ void mplayerLoadSubtitle(const char *name)
 
     if (name)
     {
+#ifdef __WINE__
+        // When the GUI receives the subtitle file name from the open dialog
+        // box it's in Windows style (C:\path\to\file), which needs to be
+        // converted for MPlayer, so that it will find the filename in the
+        // Linux filesystem.
+        name = unix_name(name);
+#endif
         mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_LoadingSubtitle, name);
         subdata = sub_read_file(name, (guiInfo.sh_video ? guiInfo.sh_video->fps : 0));
         if (!subdata)