Don't continue in case of an evLoadSubtitle error in Win32 GUI.
authorib <ib@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 13 Apr 2018 10:12:18 +0000 (10:12 +0000)
committerib <ib@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 13 Apr 2018 10:12:18 +0000 (10:12 +0000)
Calling update_set_of_subtitles() in case of a sub_read_file() error
would delete the currently used subtitle instead of loading a new one.

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

gui/win32/dialogs.c

index 63ef318..450584c 100644 (file)
@@ -75,7 +75,11 @@ void mplayerLoadSubtitle(const char *name)
     {
         mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_LoadingSubtitle, name);
         subdata = sub_read_file(strdup(name), (guiInfo.sh_video ? guiInfo.sh_video->fps : 0));
-        if (!subdata) mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub,name);
+        if (!subdata)
+        {
+            mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub,name);
+            return;
+        }
     }
     update_set_of_subtitles();
 }