From: Miguel F. <mig...@us...> - 2004-07-14 01:18:56
|
Update of /cvsroot/xine/xine-lib/src/libspudec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4996/src/libspudec Modified Files: spu.c spu.h xine_decoder.c Log Message: Moritz patch for matroska vobsub support align vobsub to bottom in libspudec Index: spu.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libspudec/spu.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- spu.c 26 Jun 2004 13:49:54 -0000 1.76 +++ spu.c 14 Jul 2004 01:18:48 -0000 1.77 @@ -488,6 +488,22 @@ spudec_discover_clut(this->stream->xine, &this->state, &this->overlay); } + if (this->state.vobsub) { + int width, height; + int64_t duration; + + /* + * vobsubs are usually played with a scaled-down stream (not full DVD + * resolution), therefore we should try to realign it. + */ + + this->stream->video_out->status(this->stream->video_out, NULL, + &width, &height, &duration ); + + this->overlay.x = (width - this->overlay.width) / 2; + this->overlay.y = height - this->overlay.height; + } + /* Subtitle */ if( this->menu_handle < 0 ) { this->menu_handle = ovl_manager->get_handle(ovl_manager,1); Index: spu.h =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libspudec/spu.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- spu.h 21 Jun 2004 16:19:41 -0000 1.26 +++ spu.h 14 Jul 2004 01:18:48 -0000 1.27 @@ -85,6 +85,7 @@ int32_t delay; /* Delay in 90Khz / 1000 */ int32_t need_clut; /* doesn't have the right clut yet */ int32_t cur_colors[4];/* current 4 colors been used */ + int32_t vobsub; /* vobsub must be aligned to bottom */ uint32_t clut[16]; } spudec_state_t; Index: xine_decoder.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libspudec/xine_decoder.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -r1.107 -r1.108 --- xine_decoder.c 21 Jun 2004 16:19:41 -0000 1.107 +++ xine_decoder.c 14 Jul 2004 01:18:48 -0000 1.108 @@ -108,7 +108,11 @@ spudec_decode_nav(this,buf); return; } - + + if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_VOBSUB_PACKAGE ) { + this->state.vobsub = 1; + } + /* check, if we need to process the next PCI from the list */ pthread_mutex_lock(&this->nav_pci_lock); spudec_update_nav(this); @@ -338,6 +342,7 @@ /* FIXME:Do we really need a default clut? */ xine_fast_memcpy(this->state.clut, __default_clut, sizeof(this->state.clut)); this->state.need_clut = 1; + this->state.vobsub = 0; return &this->spu_decoder; } |