changeset 1650:7502b16bce63

make automatic subfile detection working with many files
author atlka
date Thu, 23 Aug 2001 11:33:58 +0000
parents 5b52297e559c
children b8721b5ab23e
files mplayer.c
diffstat 1 files changed, 19 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Thu Aug 23 11:33:41 2001 +0000
+++ b/mplayer.c	Thu Aug 23 11:33:58 2001 +0000
@@ -535,22 +535,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) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
-  } else {
-      if(sub_auto && filename)  // auto load sub file ...
-         subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) );
-      if(!subtitles) subtitles=sub_read_file(get_path("default.sub")); // try default
-  }
-#endif
-
 
 #ifdef HAVE_LIRC
  #ifdef HAVE_GUI
@@ -587,6 +571,25 @@
     curr_filename=0;
 play_next_file:
     filename=(num_filenames>0)?filenames[curr_filename]:NULL;
+
+#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) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
+  } else {
+      if(sub_auto && filename) { // auto load sub file ...
+         subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) );
+      }
+      if(!subtitles) subtitles=sub_read_file(get_path("default.sub")); // try default
+  }
+#endif
+
+    
     demuxer=NULL; stream=NULL;
     
 #ifdef USE_LIBVO2