Commit d1543c2f authored by Sam Hocevar's avatar Sam Hocevar

. support 8 bits pour X (avec private colormap)

 . affinement de la dur�e d'affichage des sous-titres
 . correction d'un bug dans les sous-titres
parent 9cb93a18
...@@ -102,7 +102,8 @@ typedef struct vout_buffer_s ...@@ -102,7 +102,8 @@ typedef struct vout_buffer_s
* structure. * structure.
*****************************************************************************/ *****************************************************************************/
typedef int (vout_sys_create_t) ( p_vout_thread_t p_vout, typedef int (vout_sys_create_t) ( p_vout_thread_t p_vout,
char *psz_display, int i_root_window ); char *psz_display,
int i_root_window, void *p_data );
typedef int (vout_sys_init_t) ( p_vout_thread_t p_vout ); typedef int (vout_sys_init_t) ( p_vout_thread_t p_vout );
typedef void (vout_sys_end_t) ( p_vout_thread_t p_vout ); typedef void (vout_sys_end_t) ( p_vout_thread_t p_vout );
typedef void (vout_sys_destroy_t) ( p_vout_thread_t p_vout ); typedef void (vout_sys_destroy_t) ( p_vout_thread_t p_vout );
...@@ -224,7 +225,8 @@ typedef struct vout_thread_s ...@@ -224,7 +225,8 @@ typedef struct vout_thread_s
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window, vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
int i_width, int i_height, int *pi_status, int i_method ); int i_width, int i_height, int *pi_status,
int i_method, void *p_data );
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status ); void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type, picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type,
int i_width, int i_height ); int i_width, int i_height );
......
...@@ -288,16 +288,16 @@ static void RunThread( spudec_thread_t *p_spudec ) ...@@ -288,16 +288,16 @@ static void RunThread( spudec_thread_t *p_spudec )
/* 00 (force displaying) */ /* 00 (force displaying) */
break; break;
/* FIXME: here we have to calculate dates. It's /* FIXME: here we have to calculate dates. It's
* around i_date * 10000 but I don't know * around i_date * 12000 but I don't know
* how much exactly. * how much exactly.
*/ */
case 0x01: case 0x01:
/* 01 (start displaying) */ /* 01 (start displaying) */
p_spu->begin_date += ( i_date * 10000 ); p_spu->begin_date += ( i_date * 12000 );
break; break;
case 0x02: case 0x02:
/* 02 (stop displaying) */ /* 02 (stop displaying) */
p_spu->end_date += ( i_date * 10000 ); p_spu->end_date += ( i_date * 12000 );
break; break;
case 0x03: case 0x03:
/* 03xxxx (palette) */ /* 03xxxx (palette) */
......
...@@ -87,7 +87,8 @@ static void SetPalette ( p_vout_thread_t p_vout, u16 *red, ...@@ -87,7 +87,8 @@ static void SetPalette ( p_vout_thread_t p_vout, u16 *red,
* If not, it will be updated using one of the THREAD_* constants. * If not, it will be updated using one of the THREAD_* constants.
*****************************************************************************/ *****************************************************************************/
vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window, vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
int i_width, int i_height, int *pi_status, int i_method ) int i_width, int i_height, int *pi_status,
int i_method, void *p_data )
{ {
vout_thread_t * p_vout; /* thread descriptor */ vout_thread_t * p_vout; /* thread descriptor */
int i_status; /* thread status */ int i_status; /* thread status */
...@@ -190,7 +191,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window, ...@@ -190,7 +191,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
/* Create and initialize system-dependant method - this function issues its /* Create and initialize system-dependant method - this function issues its
* own error messages */ * own error messages */
if( p_vout->p_sys_create( p_vout, psz_display, i_root_window ) ) if( p_vout->p_sys_create( p_vout, psz_display, i_root_window, p_data ) )
{ {
TrashPlugin( p_vout->vout_plugin ); TrashPlugin( p_vout->vout_plugin );
free( p_vout ); free( p_vout );
...@@ -1856,7 +1857,6 @@ static void RenderSubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic ) ...@@ -1856,7 +1857,6 @@ static void RenderSubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
{ {
/* too late, destroying the subpic */ /* too late, destroying the subpic */
vout_DestroySubPicture( p_vout, p_subpic ); vout_DestroySubPicture( p_vout, p_subpic );
printf( "destroying subpicture\n" );
break; break;
} }
vout_RenderSPU( p_subpic->p_data, p_subpic->type.spu.i_offset, vout_RenderSPU( p_subpic->p_data, p_subpic->type.spu.i_offset,
......
...@@ -135,9 +135,9 @@ void vout_RenderSPU( byte_t *p_data, int p_offset[2], ...@@ -135,9 +135,9 @@ void vout_RenderSPU( byte_t *p_data, int p_offset[2],
{ {
if( (i_color = i_code & 0x3) ) if( (i_color = i_code & 0x3) )
{ {
u8 *p_target = &vspu.p_data[ 2 * u8 *p_target = &vspu.p_data[ i_bytes_per_pixel *
( vspu.x + vspu.y * vspu.width ) ]; ( vspu.x + vspu.y * vspu.width ) ];
memset( p_target, p_palette[i_color], 2 * (i_code >> 2) ); memset( p_target, p_palette[i_color], i_bytes_per_pixel * (i_code >> 2) );
} }
vspu.x += i_code >> 2; vspu.x += i_code >> 2;
} }
......
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