changeset 1651:b8721b5ab23e

fixed duplicated loading of sub
author arpi
date Thu, 23 Aug 2001 11:42:21 +0000
parents 7502b16bce63
children e78cf3fc992e
files mplayer.c
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Thu Aug 23 11:33:58 2001 +0000
+++ b/mplayer.c	Thu Aug 23 11:42:21 2001 +0000
@@ -535,6 +535,18 @@
   }
 #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);
+  }
+#endif
+
 
 #ifdef HAVE_LIRC
  #ifdef HAVE_GUI
@@ -574,14 +586,7 @@
 
 #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_name){
       if(sub_auto && filename) { // auto load sub file ...
          subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) );
       }
@@ -589,7 +594,6 @@
   }
 #endif
 
-    
     demuxer=NULL; stream=NULL;
     
 #ifdef USE_LIBVO2