[Mplayer-cvslog] CVS: main cfg-mplayer.h,1.74,1.75 mplayer.c,1.217,1.218 subreader.c,1.20,1.21

Adam Tla/lka atlka at mplayer.dev.hu
Mon Aug 13 13:08:20 CEST 2001


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

Modified Files:
	cfg-mplayer.h mplayer.c subreader.c 
Log Message:
changes according to -utf8 option, draw_osd() function added


Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- cfg-mplayer.h	6 Aug 2001 00:30:29 -0000	1.74
+++ cfg-mplayer.h	13 Aug 2001 11:08:18 -0000	1.75
@@ -35,6 +35,7 @@
 
 #ifdef USE_SUB
 extern int sub_unicode;
+extern int sub_utf8;
 #endif
 
 #ifdef USE_OSD
@@ -92,6 +93,8 @@
         {"noautosub", &sub_auto, CONF_TYPE_FLAG, 0, 1, 0},
 	{"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1},
 	{"nounicode", &sub_unicode, CONF_TYPE_FLAG, 0, 1, 0},
+	{"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1},
+	{"noutf8", &sub_utf8, CONF_TYPE_FLAG, 0, 1, 0},
 #endif
 #ifdef USE_OSD
 	{"font", &font_name, CONF_TYPE_STRING, 0, 0, 0},

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -r1.217 -r1.218
--- mplayer.c	12 Aug 2001 20:52:35 -0000	1.217
+++ mplayer.c	13 Aug 2001 11:08:18 -0000	1.218
@@ -1216,6 +1216,10 @@
   vdecode_time=video_time_usage-vdecode_time;
 
 //------------------------ frame decoded. --------------------
+//------------------------ add OSD to frame contents ---------
+#ifndef USE_LIBVO2
+    video_out->draw_osd();
+#endif
 
     // Increase video timers:
     sh_video->num_frames+=frame_time;
@@ -1255,7 +1259,7 @@
 	      printf("\nstill dropping, %.2f\n", time_frame);
 	  }
       }
-
+      video_out->check_events(); // check events AST
     } else {
       // It's time to sleep...
       current_module="sleep";
@@ -1304,6 +1308,7 @@
 #ifdef USE_LIBVO2
         if(blit_frame) vo2_flip(video_out,0);
 #else
+	video_out->check_events();
         if(blit_frame) video_out->flip_page();
 #endif
 //        usec_sleep(50000); // test only!
@@ -1532,16 +1537,19 @@
     case 'x':
       sub_delay += 0.1;
       break;
+    case '9': c='/'; goto _jump1;
+    case '0': c='*';
+_jump1:
     case '*':
     case '/': {
         float mixer_l, mixer_r;
         mixer_getvolume( &mixer_l,&mixer_r );
         if(c=='*'){
-            mixer_l++; if ( mixer_l > 100 ) mixer_l = 100;
-            mixer_r++; if ( mixer_r > 100 ) mixer_r = 100;
+            if ( ++mixer_l > 100 ) mixer_l = 100;
+            if ( ++mixer_r > 100 ) mixer_r = 100;
         } else {
-            mixer_l--; if ( mixer_l < 0 ) mixer_l = 0;
-            mixer_r--; if ( mixer_r < 0 ) mixer_r = 0;
+            if ( --mixer_l < 0 ) mixer_l = 0;
+            if ( --mixer_r < 0 ) mixer_r = 0;
         }
         mixer_setvolume( mixer_l,mixer_r );
 
@@ -1563,9 +1571,9 @@
     case '1':
     case '2':
         if(c=='2'){
-	    if ( v_cont++ > 100 ) v_cont = 100;
+	    if ( ++v_cont > 100 ) v_cont = 100;
         } else {
-    	    if ( v_cont-- < 0 ) v_cont = 0;	    
+    	    if ( --v_cont < 0 ) v_cont = 0;	    
         }
 	if(set_video_colors(sh_video,"Contrast",v_cont)){
 #ifdef USE_OSD
@@ -1582,9 +1590,9 @@
     case '3':
     case '4':
         if(c=='4'){
-	    if ( v_bright++ > 100 ) v_bright = 100;
+	    if ( ++v_bright > 100 ) v_bright = 100;
         } else {
-    	    if ( v_bright-- < 0 ) v_bright = 0;	    
+    	    if ( --v_bright < 0 ) v_bright = 0;	    
         }
 	if(set_video_colors(sh_video,"Brightness",v_bright)){
 #ifdef USE_OSD
@@ -1601,9 +1609,9 @@
     case '5':
     case '6':
         if(c=='6'){
-	    if ( v_hue++ > 100 ) v_hue = 100;
+	    if ( ++v_hue > 100 ) v_hue = 100;
         } else {
-    	    if ( v_hue-- < 0 ) v_hue = 0;	    
+    	    if ( --v_hue < 0 ) v_hue = 0;	    
         }
 	if(set_video_colors(sh_video,"Hue",v_hue)){
 #ifdef USE_OSD
@@ -1620,9 +1628,9 @@
     case '7':
     case '8':
         if(c=='8'){
-	    if ( v_saturation++ > 100 ) v_saturation = 100;
+	    if ( ++v_saturation > 100 ) v_saturation = 100;
         } else {
-    	    if ( v_saturation-- < 0 ) v_saturation = 0;	    
+    	    if ( --v_saturation < 0 ) v_saturation = 0;	    
         }
 	if(set_video_colors(sh_video,"Saturation",v_saturation)){
 #ifdef USE_OSD

Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- subreader.c	9 Jun 2001 20:09:18 -0000	1.20
+++ subreader.c	13 Aug 2001 11:08:18 -0000	1.21
@@ -437,6 +437,7 @@
 
 char * sub_filename(char* path,  char * fname )
 {
+ extern int sub_utf8;
  char * sub_name1;
  char * sub_name2;
  char * aviptr1, * aviptr2, * tmp;
@@ -444,7 +445,9 @@
  FILE * f;
  int pos=0;
  char * sub_exts[] = 
-  { ".sub",
+  { ".utf",
+    ".UTF",
+    ".sub",
     ".SUB",
     ".srt",
     ".SRT",
@@ -484,6 +487,7 @@
    if((f=fopen( sub_name,"rt" ))) {
      fclose( f );
      printf( "SUB: Detected sub file: %s\n",sub_name );
+     if (i<2) sub_utf8=1;
      return sub_name;
    }
   }




More information about the MPlayer-cvslog mailing list