[Mplayer-cvslog] CVS: main mplayer.c,1.398,1.399

Atmosfear atmos4 at mplayer.dev.hu
Wed Feb 20 23:41:13 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv21647

Modified Files:
	mplayer.c 
Log Message:
autodetect vobsub filename, disable autosub if vobsub found.

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.398
retrieving revision 1.399
diff -u -r1.398 -r1.399
--- mplayer.c	18 Feb 2002 17:34:14 -0000	1.398
+++ mplayer.c	20 Feb 2002 22:41:06 -0000	1.399
@@ -764,6 +764,22 @@
 
     if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename);
 
+    current_module="vobsub";
+    if (vobsub_name){
+      vo_vobsub=vobsub_open(vobsub_name);
+      if(vo_vobsub==NULL)
+        mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,vobsub_name);
+    }else if(sub_auto && filename && (strlen(filename)>=5)){
+      /* try to autodetect vobsub from movie filename ::atmos */
+      char *buf = malloc((strlen(filename)-3) * sizeof(char));
+      memset(buf,0,strlen(filename)-3); // make sure string is terminated
+      strncpy(buf, filename, strlen(filename)-4); 
+      vo_vobsub=vobsub_open(buf);
+      free(buf);
+    }
+    if(vo_vobsub)
+      sub_auto=0; // don't do autosub for textsubs if vobsub found
+
 #ifdef USE_SUB_OLD
 // check .sub
   if(sub_name){
@@ -788,13 +804,6 @@
   if(subtitles && stream_dump_type==3) list_sub_file(subtitles);
   if(subtitles && stream_dump_type==4) dump_mpsub(subtitles, fps);
 #endif
-
-  current_module="vobsub";
-  if (vobsub_name){
-    vo_vobsub=vobsub_open(vobsub_name);
-    if(vo_vobsub==NULL)
-      mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,vobsub_name);
-  }
 
     stream=NULL;
     demuxer=NULL;




More information about the MPlayer-cvslog mailing list