Commit 46f6ef76 authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer

    which caused subtitles to appear slanted in odd width windows.
parent 2175c26e
......@@ -4,6 +4,8 @@
HEAD
* ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer
which caused subtitles to appear slanted in odd width windows.
* ./plugins/gtk/gtk_display.c, ./plugins/win32/mainframe.cpp: we deactivate
popup menus when no stream is being played, even in network mode.
* ./src/input/mpeg_system.c: removed unnecessarily verbose message.
......
......@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spu_decoder.c,v 1.24 2002/05/24 12:42:14 gbazin Exp $
* $Id: spu_decoder.c,v 1.24.2.1 2002/06/02 13:41:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
......@@ -916,7 +916,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
p_dest = p_pic->p->p_pixels + ( i_width >> 6 ) * 2
/* Add the picture coordinates and the SPU coordinates */
+ ( (p_spu->i_x * i_xscale) >> 6 ) * 2
+ ( (p_spu->i_y * i_yscale) >> 6 ) * p_vout->output.i_width * 2;
+ ( (p_spu->i_y * i_yscale) >> 6 ) * p_pic->p->i_pitch;
/* Draw until we reach the bottom of the subtitle */
for( i_y = 0 ; i_y < i_height ; )
......@@ -928,7 +928,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
if( i_ytmp + 1 >= ( i_y >> 6 ) )
{
/* Just one line : we precalculate i_y >> 6 */
i_yreal = p_vout->output.i_width * 2 * i_ytmp;
i_yreal = p_pic->p->i_pitch * i_ytmp;
/* Draw until we reach the end of the line */
for( i_x = i_width ; i_x ; )
......@@ -964,8 +964,8 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
}
else
{
i_yreal = p_vout->output.i_width * 2 * i_ytmp;
i_ynext = p_vout->output.i_width * 2 * i_y >> 6;
i_yreal = p_pic->p->i_pitch * i_ytmp;
i_ynext = p_pic->p->i_pitch * i_y >> 6;
/* Draw until we reach the end of the line */
for( i_x = i_width ; i_x ; )
......@@ -982,7 +982,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
case 0x0f:
i_len = i_xscale * ( *p_source++ >> 2 );
for( i_ytmp = i_yreal ; i_ytmp < i_ynext ;
i_ytmp += p_vout->output.i_width * 2 )
i_ytmp += p_pic->p->i_pitch )
{
memset( p_dest - 2 * ( i_x >> 6 ) + i_ytmp,
p_clut16[ i_color ],
......@@ -995,7 +995,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
/* FIXME: we should do transparency */
i_len = i_xscale * ( *p_source++ >> 2 );
for( i_ytmp = i_yreal ; i_ytmp < i_ynext ;
i_ytmp += p_vout->output.i_width * 2 )
i_ytmp += p_pic->p->i_pitch )
{
memset( p_dest - 2 * ( i_x >> 6 ) + i_ytmp,
p_clut16[ i_color ],
......@@ -1031,7 +1031,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
p_dest = p_pic->p->p_pixels + ( i_width >> 6 ) * 4
/* Add the picture coordinates and the SPU coordinates */
+ ( (p_spu->i_x * i_xscale) >> 6 ) * 4
+ ( (p_spu->i_y * i_yscale) >> 6 ) * p_vout->output.i_width * 4;
+ ( (p_spu->i_y * i_yscale) >> 6 ) * p_pic->p->i_pitch;
/* Draw until we reach the bottom of the subtitle */
for( i_y = 0 ; i_y < i_height ; )
......@@ -1043,7 +1043,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
if( i_ytmp + 1 >= ( i_y >> 6 ) )
{
/* Just one line : we precalculate i_y >> 6 */
i_yreal = p_vout->output.i_width * 4 * i_ytmp;
i_yreal = p_pic->p->i_pitch * i_ytmp;
/* Draw until we reach the end of the line */
for( i_x = i_width ; i_x ; )
......@@ -1077,8 +1077,8 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
}
else
{
i_yreal = p_vout->output.i_width * 4 * i_ytmp;
i_ynext = p_vout->output.i_width * 4 * i_y >> 6;
i_yreal = p_pic->p->i_pitch * i_ytmp;
i_ynext = p_pic->p->i_pitch * i_y >> 6;
/* Draw until we reach the end of the line */
for( i_x = i_width ; i_x ; )
......@@ -1095,7 +1095,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
case 0x0f:
i_len = i_xscale * ( *p_source++ >> 2 );
for( i_ytmp = i_yreal ; i_ytmp < i_ynext ;
i_ytmp += p_vout->output.i_width * 4 )
i_ytmp += p_pic->p->i_pitch )
{
memset( p_dest - 4 * ( i_x >> 6 ) + i_ytmp,
p_clut32[ i_color ],
......@@ -1108,7 +1108,7 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
/* FIXME: we should do transparency */
i_len = i_xscale * ( *p_source++ >> 2 );
for( i_ytmp = i_yreal ; i_ytmp < i_ynext ;
i_ytmp += p_vout->output.i_width * 4 )
i_ytmp += p_pic->p->i_pitch )
{
memset( p_dest - 4 * ( i_x >> 6 ) + i_ytmp,
p_clut32[ i_color ],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment