diff mplayer.c @ 3499:93351eec9f1f

Add subtitle loader for gui
author pontscho
date Sat, 15 Dec 2001 15:36:07 +0000
parents 47983b6a042d
children 19998399f4d5
line wrap: on
line diff
--- a/mplayer.c	Fri Dec 14 23:56:12 2001 +0000
+++ b/mplayer.c	Sat Dec 15 15:36:07 2001 +0000
@@ -589,18 +589,6 @@
   }
 #endif
 
-#ifdef USE_SUB
-// check .sub
-  if(sub_name){
-       int l=strlen(sub_name);
-       if ((l>4) && ((0==strcmp(&sub_name[l-4],".utf"))
-		   ||(0==strcmp(&sub_name[l-4],".UTF"))))
-	  sub_utf8=1;
-       subtitles=sub_read_file(sub_name);
-       if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
-  }
-#endif
-
   // It's time to init the GUI code: (and fork() the GTK process)
 #ifdef HAVE_NEW_GUI
   if(use_gui){
@@ -678,6 +666,10 @@
       if(mplShMem->FilenameChanged){
         filename=mplShMem->Filename;
       }
+#ifdef USE_SUB
+      sub_name=NULL;
+      if ( mplShMem->SubtitleChanged ) sub_name=mplShMem->Subtitlename;
+#endif
     }
 #endif
 
@@ -685,6 +677,14 @@
 
 #ifdef USE_SUB
 // check .sub
+  if(sub_name){
+       int l=strlen(sub_name);
+       if ((l>4) && ((0==strcmp(&sub_name[l-4],".utf"))
+		   ||(0==strcmp(&sub_name[l-4],".UTF"))))
+	  sub_utf8=1;
+       subtitles=sub_read_file(sub_name);
+       if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
+  }
   if(!sub_name){
       if(sub_auto && filename) { // auto load sub file ...
          subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) );