Mercurial > mplayer.hg
comparison Gui/interface.c @ 7169:35bab6be713b
add subtitle dropping support
author | pontscho |
---|---|
date | Fri, 30 Aug 2002 19:11:03 +0000 |
parents | 9e17b153b785 |
children | 4ae1a0fecac5 |
comparison
equal
deleted
inserted
replaced
7168:cb1428dd4d79 | 7169:35bab6be713b |
---|---|
18 #include "../help_mp.h" | 18 #include "../help_mp.h" |
19 #include "../subreader.h" | 19 #include "../subreader.h" |
20 #include "../libvo/x11_common.h" | 20 #include "../libvo/x11_common.h" |
21 #include "../libvo/video_out.h" | 21 #include "../libvo/video_out.h" |
22 #include "../libvo/font_load.h" | 22 #include "../libvo/font_load.h" |
23 #include "../libvo/sub.h" | |
23 #include "../input/input.h" | 24 #include "../input/input.h" |
24 #include "../libao2/audio_out.h" | 25 #include "../libao2/audio_out.h" |
25 #include "../mixer.h" | 26 #include "../mixer.h" |
26 #include "../libao2/audio_plugin.h" | 27 #include "../libao2/audio_plugin.h" |
27 #include "../libao2/eq.h" | 28 #include "../libao2/eq.h" |
237 #endif | 238 #endif |
238 } | 239 } |
239 #endif | 240 #endif |
240 | 241 |
241 #ifdef USE_SUB | 242 #ifdef USE_SUB |
243 extern mp_osd_obj_t* vo_osd_list; | |
244 | |
242 void guiLoadSubtitle( char * name ) | 245 void guiLoadSubtitle( char * name ) |
243 { | 246 { |
244 if ( guiIntfStruct.Playing == 0 ) | 247 if ( guiIntfStruct.Playing == 0 ) |
245 { | 248 { |
246 guiIntfStruct.SubtitleChanged=1; | 249 guiIntfStruct.SubtitleChanged=1; |
247 return; | 250 return; |
248 } | 251 } |
249 if ( subtitles ) | 252 if ( subtitles ) |
250 { | 253 { |
254 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete subtitles.\n" ); | |
251 sub_free( subtitles ); | 255 sub_free( subtitles ); |
252 if ( sub_name ) free( sub_name ); | 256 subtitles=NULL; |
253 sub_name=NULL; | 257 sub_name=NULL; |
254 vo_sub=NULL; | 258 vo_sub=NULL; |
255 subtitles=NULL; | 259 if ( vo_osd_list ) |
260 { | |
261 int len; | |
262 mp_osd_obj_t * osd = vo_osd_list; | |
263 while ( osd ) | |
264 { | |
265 if ( osd->type == OSDTYPE_SUBTITLE ) break; | |
266 osd=osd->next; | |
267 } | |
268 if ( osd && osd->flags&OSDFLAG_VISIBLE ) | |
269 { | |
270 len=osd->stride * ( osd->bbox.y2 - osd->bbox.y1 ); | |
271 memset( osd->bitmap_buffer,0,len ); | |
272 memset( osd->alpha_buffer,0,len ); | |
273 } | |
274 } | |
256 } | 275 } |
257 sub_name=gstrdup( name ); | 276 if ( name ) |
258 subtitles=sub_read_file( sub_name,guiIntfStruct.FPS ); | 277 { |
278 mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete Load subtitle: %s\n",name ); | |
279 sub_name=gstrdup( name ); | |
280 subtitles=sub_read_file( sub_name,guiIntfStruct.FPS ); | |
281 } | |
259 } | 282 } |
260 #endif | 283 #endif |
261 | 284 |
262 static void add_vop( char * str ) | 285 static void add_vop( char * str ) |
263 { | 286 { |