From ecfafd848b19c3ffb8279b9c57753acc305c3a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sun, 29 May 2005 10:18:22 +0000 Subject: *BUGFIX* Trying to fix subtitle repositioning after change of video windows size. The problem was new renderer object was always recreated AFTER text drawing for duration == 0. I removed additional subtitle size update which was called always before waiting for showing subtitle and now update is called only on start and just before drawing. ffmpeg, win32 and maybe other decoders still needs to be fixed to return non-zero image duration. Some format of subtitles need know image duration. And minor change: removed strange test for this->renderer != NULL. Anyway proper way in such case would be close the plugin. CVS patchset: 7590 CVS date: 2005/05/29 10:18:22 --- ChangeLog | 1 + src/libsputext/xine_decoder.c | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e09ce1d6e..2be85cebd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ xine-lib (1.0.2) * Fix xxmc bob deinterlacing for field-coded interlaced streams * Fix LE_64/BE_64 macros on non-x86 plataforms. may fixes issues with some demuxers like avi, asf and ogg. + * sputext improvements/workarounds xine-lib (1.0.1) * Big XvMC quality / correctness / cpu-usage fix. [bug #1114517] diff --git a/src/libsputext/xine_decoder.c b/src/libsputext/xine_decoder.c index 01486f075..c4100f0e0 100644 --- a/src/libsputext/xine_decoder.c +++ b/src/libsputext/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.89 2005/05/23 17:13:35 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.90 2005/05/29 10:18:23 valtri Exp $ * */ @@ -133,14 +133,13 @@ static void update_font_size (sputext_decoder_t *this, int force_update) { if( this->osd ) this->renderer->free_object (this->osd); - if(this->renderer) { - this->osd = this->renderer->new_object (this->renderer, - this->width, - SUB_MAX_TEXT * this->line_height); + lprintf("new osd object, width %d, height %d*%d\n", this->width, SUB_MAX_TEXT, this->line_height); + this->osd = this->renderer->new_object (this->renderer, + this->width, + SUB_MAX_TEXT * this->line_height); - this->renderer->set_font (this->osd, this->class->font, this->font_size); - this->renderer->set_position (this->osd, 0, y); - } + this->renderer->set_font (this->osd, this->class->font, this->font_size); + this->renderer->set_position (this->osd, 0, y); } } @@ -175,7 +174,7 @@ static void update_output_size (sputext_decoder_t *this) { this->height = this->stream->video_out->get_property(this->stream->video_out, VO_PROP_WINDOW_HEIGHT); - if(!this->osd || (this->width && this->height && this->img_duration)) { + if(!this->osd || (this->width && this->height)) { this->renderer = this->stream->osd_renderer; update_font_size (this, 1); @@ -191,7 +190,7 @@ static void update_output_size (sputext_decoder_t *this) { this->stream->video_out->status(this->stream->video_out, NULL, &this->width, &this->height, &this->img_duration ); - if(!this->osd || ( this->width && this->height && this->img_duration)) { + if(!this->osd || ( this->width && this->height)) { this->renderer = this->stream->osd_renderer; update_font_size (this, 1); @@ -707,6 +706,8 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { this->width = this->height = 0; this->started = 1; + + update_output_size( this ); } if( this->started ) { @@ -721,8 +722,6 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { return; } - update_output_size( this ); - if( this->osd ) { /* try to use frame number mode */ -- cgit v1.2.3