[Mplayer-cvslog] CVS: main/Gui events.c,1.11,1.12 events.h,1.13,1.14 interface.c,1.45,1.46

Zoltan Ponekker pontscho at mplayerhq.hu
Fri Aug 30 21:11:04 CEST 2002


Update of /cvsroot/mplayer/main/Gui
In directory mail:/var/tmp.root/cvs-serv7575/Gui

Modified Files:
	events.c events.h interface.c 
Log Message:
add subtitle dropping support

Index: events.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/events.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- events.c	2 Jul 2002 22:31:48 -0000	1.11
+++ events.c	30 Aug 2002 19:11:01 -0000	1.12
@@ -47,7 +47,8 @@
   { evPlayDVD,		 "evPlayDVD"	       },
   { evPlayVCD,		 "evPlayVCD"	       },
   { evSetURL,		 "evSetURL"	       },
-  { evLoadAudioFile,	 "evLoadAudioFile"     }
+  { evLoadAudioFile,	 "evLoadAudioFile"     },
+  { evDropSubtitle,      "evDropSubtitle"      }
  };
 
 int evBoxs = sizeof( evNames ) / sizeof( evName );

Index: events.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/events.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- events.h	2 Jul 2002 22:31:48 -0000	1.13
+++ events.h	30 Aug 2002 19:11:01 -0000	1.14
@@ -47,10 +47,12 @@
 #define evHelp              37
 
 #define evLoadSubtitle      38
+#define evDropSubtitle      43
 #define evPlayDVD           39
 #define evPlayVCD	    40
 #define evPlayNetwork       41
 #define evLoadAudioFile	    42
+// 44 ...
 
 #define evExit              1000
 

Index: interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- interface.c	29 Aug 2002 23:15:15 -0000	1.45
+++ interface.c	30 Aug 2002 19:11:01 -0000	1.46
@@ -20,6 +20,7 @@
 #include "../libvo/x11_common.h"
 #include "../libvo/video_out.h"
 #include "../libvo/font_load.h"
+#include "../libvo/sub.h"
 #include "../input/input.h"
 #include "../libao2/audio_out.h"
 #include "../mixer.h"
@@ -239,6 +240,8 @@
 #endif
 
 #ifdef USE_SUB
+extern mp_osd_obj_t* vo_osd_list;
+
 void guiLoadSubtitle( char * name )
 {
  if ( guiIntfStruct.Playing == 0 )
@@ -248,14 +251,34 @@
   }
  if ( subtitles )
   {
+   mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete subtitles.\n" );
    sub_free( subtitles );
-   if ( sub_name ) free( sub_name );
+   subtitles=NULL;
    sub_name=NULL;
    vo_sub=NULL;
-   subtitles=NULL;
+   if ( vo_osd_list )
+    {
+     int len;
+     mp_osd_obj_t * osd = vo_osd_list;
+     while ( osd )
+      {
+       if ( osd->type == OSDTYPE_SUBTITLE ) break;
+       osd=osd->next;
+      }
+     if ( osd && osd->flags&OSDFLAG_VISIBLE )
+      {
+       len=osd->stride * ( osd->bbox.y2 - osd->bbox.y1 );
+       memset( osd->bitmap_buffer,0,len );
+       memset( osd->alpha_buffer,0,len );
+      }
+    }
+  }
+ if ( name )
+  {
+   mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete Load subtitle: %s\n",name );
+   sub_name=gstrdup( name );
+   subtitles=sub_read_file( sub_name,guiIntfStruct.FPS );
   }
- sub_name=gstrdup( name );
- subtitles=sub_read_file( sub_name,guiIntfStruct.FPS );
 }
 #endif
 




More information about the MPlayer-cvslog mailing list