summaryrefslogtreecommitdiffstats
path: root/Gui/interface.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-30 19:11:03 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-30 19:11:03 +0000
commit25f8352ffe541d6548b0943164d3177c984d6368 (patch)
treef58db5380a728179e729e3a547321b04dbc3bef8 /Gui/interface.c
parent7caf8770b8e61b860b0027e31e419aaa32a13475 (diff)
downloadmpv-25f8352ffe541d6548b0943164d3177c984d6368.tar.bz2
mpv-25f8352ffe541d6548b0943164d3177c984d6368.tar.xz
add subtitle dropping support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7170 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/interface.c')
-rw-r--r--Gui/interface.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/Gui/interface.c b/Gui/interface.c
index 2ee5c5fe54..9b08abf16e 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -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 @@ void guiLoadFont( void )
#endif
#ifdef USE_SUB
+extern mp_osd_obj_t* vo_osd_list;
+
void guiLoadSubtitle( char * name )
{
if ( guiIntfStruct.Playing == 0 )
@@ -248,14 +251,34 @@ void guiLoadSubtitle( char * name )
}
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