diff options
Diffstat (limited to 'src/libspudec')
-rw-r--r-- | src/libspudec/spu.c | 18 | ||||
-rw-r--r-- | src/libspudec/spu.h | 3 | ||||
-rw-r--r-- | src/libspudec/xine_decoder.c | 9 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index 8d4bdcc5e..336837737 100644 --- a/src/libspudec/spu.c +++ b/src/libspudec/spu.c @@ -36,7 +36,7 @@ * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: spu.c,v 1.76 2004/06/26 13:49:54 mroi Exp $ + * $Id: spu.c,v 1.77 2004/07/14 01:18:48 miguelfreitas Exp $ * */ @@ -488,6 +488,22 @@ void spudec_process (spudec_decoder_t *this, int stream_id) { 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); diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h index 6da793f1c..91f4f8ab6 100644 --- a/src/libspudec/spu.h +++ b/src/libspudec/spu.h @@ -19,7 +19,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: spu.h,v 1.26 2004/06/21 16:19:41 mroi Exp $ + * $Id: spu.h,v 1.27 2004/07/14 01:18:48 miguelfreitas Exp $ * * This file was originally part of the OMS program. * @@ -85,6 +85,7 @@ typedef struct { 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; diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index 5fa10b944..985d3305d 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -19,7 +19,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.107 2004/06/21 16:19:41 mroi Exp $ + * $Id: xine_decoder.c,v 1.108 2004/07/14 01:18:48 miguelfreitas Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -108,7 +108,11 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { 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 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t /* 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; } |