Commit 14dd917d authored by Laurent Aimar's avatar Laurent Aimar

Removed unused or redondant fields from subpicture.

I removed:
 i_x/i_y: redondant with region i_x/i_y. Now a subpicture always represent the
 whole video.
 i_flags: unused anywhere in the core.

 I may have broken a few video filters (osdmenu mainly). I will fix it if you
report the problem and the way to reproduce it.
parent 3318cf72
...@@ -353,14 +353,11 @@ struct subpicture_t ...@@ -353,14 +353,11 @@ struct subpicture_t
* changed by the video output thread, or simply ignored depending of the * changed by the video output thread, or simply ignored depending of the
* subtitle type. */ * subtitle type. */
/**@{*/ /**@{*/
int i_x; /**< offset from alignment position */
int i_y; /**< offset from alignment position */
int i_alpha; /**< transparency */
int i_original_picture_width; /**< original width of the movie */ int i_original_picture_width; /**< original width of the movie */
int i_original_picture_height;/**< original height of the movie */ int i_original_picture_height;/**< original height of the movie */
bool b_absolute; /**< position is absolute */
int i_flags; /**< position flags */
bool b_subtitle; /**< the picture is a movie subtitle */ bool b_subtitle; /**< the picture is a movie subtitle */
bool b_absolute; /**< position is absolute */
int i_alpha; /**< transparency */
/**@}*/ /**@}*/
/** Pointer to function that renders this subtitle in a picture */ /** Pointer to function that renders this subtitle in a picture */
......
...@@ -357,8 +357,8 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h ...@@ -357,8 +357,8 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
/* Decode and format the subpicture unit */ /* Decode and format the subpicture unit */
/* Normal text subs, easy markup */ /* Normal text subs, easy markup */
p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM;// | SUBPICTURE_ALIGN_LEFT;// | p_sys->i_align; p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM;// | SUBPICTURE_ALIGN_LEFT;// | p_sys->i_align;
p_spu->i_x = 0; //p_sys->i_align ? 20 : 0; p_spu->p_region->i_x = 0; //p_sys->i_align ? 20 : 0;
p_spu->i_y = 10; p_spu->p_region->i_y = 10;
p_spu->p_region->psz_text = psz_subtitle; p_spu->p_region->psz_text = psz_subtitle;
p_spu->p_region->psz_html = psz_html; p_spu->p_region->psz_html = psz_html;
......
...@@ -204,8 +204,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -204,8 +204,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
memcpy( p_spu->p_sys->p_subs_data, p_block->p_buffer, memcpy( p_spu->p_sys->p_subs_data, p_block->p_buffer,
p_block->i_buffer ); p_block->i_buffer );
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->i_start = p_block->i_pts; p_spu->i_start = p_block->i_pts;
p_spu->i_stop = p_block->i_pts + p_block->i_length; p_spu->i_stop = p_block->i_pts + p_block->i_length;
p_spu->b_ephemer = false; p_spu->b_ephemer = false;
......
...@@ -504,9 +504,6 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data ) ...@@ -504,9 +504,6 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
p_spu = p_dec->pf_spu_buffer_new( p_dec ); p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL; if( !p_spu ) return NULL;
p_spu->i_x = p_sys->i_x_start;
p_spu->i_x = p_spu->i_x * 3 / 4; /* FIXME: use aspect ratio for x? */
p_spu->i_y = p_sys->i_y_start;
p_spu->i_start = p_data->i_pts; p_spu->i_start = p_data->i_pts;
p_spu->i_stop = p_data->i_pts + p_sys->i_duration; p_spu->i_stop = p_data->i_pts + p_sys->i_duration;
p_spu->b_ephemer = true; p_spu->b_ephemer = true;
...@@ -526,7 +523,9 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data ) ...@@ -526,7 +523,9 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
} }
p_spu->p_region = p_region; p_spu->p_region = p_region;
p_region->i_x = p_region->i_y = 0; p_region->i_x = p_sys->i_x_start;
p_region->i_x = p_region->i_x * 3 / 4; /* FIXME: use aspect ratio for x? */
p_region->i_y = p_sys->i_y_start;
/* Build palette */ /* Build palette */
fmt.p_palette->i_entries = 4; fmt.p_palette->i_entries = 4;
......
...@@ -1446,10 +1446,42 @@ static subpicture_t *render( decoder_t *p_dec ) ...@@ -1446,10 +1446,42 @@ static subpicture_t *render( decoder_t *p_dec )
subpicture_t *p_spu; subpicture_t *p_spu;
subpicture_region_t **pp_spu_region; subpicture_region_t **pp_spu_region;
int i, j, i_timeout = 0; int i, j, i_timeout = 0;
int i_base_x;
int i_base_y;
/* Allocate the subpicture internal data. */ /* Allocate the subpicture internal data. */
p_spu = p_dec->pf_spu_buffer_new( p_dec ); p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL; if( !p_spu )
return NULL;
p_spu->b_absolute = p_sys->b_absolute;
/* Set the pf_render callback */
p_spu->i_start = (mtime_t) p_sys->i_pts;
//p_spu->i_stop = (mtime_t) 0;
p_spu->b_ephemer = true;
//p_spu->b_fade = true;
//p_spu->i_stop = p_spu->i_start + (mtime_t) (i_timeout * 1000000);
/* Correct positioning of SPU */
i_base_x = p_sys->i_spu_x;
i_base_y = p_sys->i_spu_y;
p_spu->i_original_picture_width = 720;
p_spu->i_original_picture_height = 576;
if( p_sys->p_display )
{
p_spu->i_original_picture_width = p_sys->p_display->i_width;
p_spu->i_original_picture_height = p_sys->p_display->i_height;
if( p_sys->p_display->b_windowed )
{
/* TODO: check that this actually works */
p_spu->i_original_picture_width = p_sys->p_display->i_max_x - p_sys->p_display->i_x;
p_spu->i_original_picture_height = p_sys->p_display->i_max_y - p_sys->p_display->i_y;
i_base_x += p_sys->p_display->i_x;
i_base_y += p_sys->p_display->i_y;
}
}
pp_spu_region = &p_spu->p_region; pp_spu_region = &p_spu->p_region;
...@@ -1519,8 +1551,8 @@ static subpicture_t *render( decoder_t *p_dec ) ...@@ -1519,8 +1551,8 @@ static subpicture_t *render( decoder_t *p_dec )
msg_Err( p_dec, "cannot allocate SPU region" ); msg_Err( p_dec, "cannot allocate SPU region" );
continue; continue;
} }
p_spu_region->i_x = p_regiondef->i_x; p_spu_region->i_x = i_base_x + p_regiondef->i_x;
p_spu_region->i_y = p_regiondef->i_y; p_spu_region->i_y = i_base_y + p_regiondef->i_y;
p_spu_region->i_align = p_sys->i_spu_position; p_spu_region->i_align = p_sys->i_spu_position;
*pp_spu_region = p_spu_region; *pp_spu_region = p_spu_region;
pp_spu_region = &p_spu_region->p_next; pp_spu_region = &p_spu_region->p_next;
...@@ -1574,43 +1606,14 @@ static subpicture_t *render( decoder_t *p_dec ) ...@@ -1574,43 +1606,14 @@ static subpicture_t *render( decoder_t *p_dec )
} }
p_spu_region->psz_text = strdup( p_object_def->psz_text ); p_spu_region->psz_text = strdup( p_object_def->psz_text );
p_spu_region->i_x = p_regiondef->i_x + p_object_def->i_x; p_spu_region->i_x = i_base_x + p_regiondef->i_x + p_object_def->i_x;
p_spu_region->i_y = p_regiondef->i_y + p_object_def->i_y; p_spu_region->i_y = i_base_y + p_regiondef->i_y + p_object_def->i_y;
p_spu_region->i_align = p_sys->i_spu_position; p_spu_region->i_align = p_sys->i_spu_position;
*pp_spu_region = p_spu_region; *pp_spu_region = p_spu_region;
pp_spu_region = &p_spu_region->p_next; pp_spu_region = &p_spu_region->p_next;
} }
} }
/* Set the pf_render callback */
p_spu->i_start = (mtime_t) p_sys->i_pts;
//p_spu->i_stop = (mtime_t) 0;
p_spu->b_ephemer = true;
//p_spu->b_fade = true;
//p_spu->i_stop = p_spu->i_start + (mtime_t) (i_timeout * 1000000);
/* Correct positioning of SPU */
p_spu->b_absolute = p_sys->b_absolute;
p_spu->i_x = p_sys->i_spu_x;
p_spu->i_y = p_sys->i_spu_y;
p_spu->i_original_picture_width = 720;
p_spu->i_original_picture_height = 576;
if( p_sys->p_display )
{
p_spu->i_original_picture_width = p_sys->p_display->i_width;
p_spu->i_original_picture_height = p_sys->p_display->i_height;
if( p_sys->p_display->b_windowed )
{
/* TODO: check that this actually works */
p_spu->i_original_picture_width = p_sys->p_display->i_max_x - p_sys->p_display->i_x;
p_spu->i_original_picture_height = p_sys->p_display->i_max_y - p_sys->p_display->i_y;
p_spu->i_x += p_sys->p_display->i_x;
p_spu->i_y += p_sys->p_display->i_y;
}
}
return p_spu; return p_spu;
} }
...@@ -2092,8 +2095,8 @@ static void encode_page_composition( encoder_t *p_enc, bs_t *s, ...@@ -2092,8 +2095,8 @@ static void encode_page_composition( encoder_t *p_enc, bs_t *s,
} }
else else
{ {
bs_write( s, 16, p_subpic->i_x + p_region->i_x ); bs_write( s, 16, p_region->i_x );
bs_write( s, 16, p_subpic->i_y + p_region->i_y ); bs_write( s, 16, p_region->i_y );
} }
} }
} }
......
...@@ -272,8 +272,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -272,8 +272,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
memcpy( p_spu->p_sys->p_subs_data, p_block->p_buffer, memcpy( p_spu->p_sys->p_subs_data, p_block->p_buffer,
p_block->i_buffer ); p_block->i_buffer );
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->i_start = p_block->i_pts; p_spu->i_start = p_block->i_pts;
p_spu->i_stop = p_block->i_pts + p_block->i_length; p_spu->i_stop = p_block->i_pts + p_block->i_length;
p_spu->b_ephemer = true; p_spu->b_ephemer = true;
......
...@@ -44,6 +44,8 @@ typedef struct ...@@ -44,6 +44,8 @@ typedef struct
{ {
int i_width; int i_width;
int i_height; int i_height;
int i_x;
int i_y;
} spu_properties_t; } spu_properties_t;
static int ParseControlSeq( decoder_t *, subpicture_t *, subpicture_data_t *, static int ParseControlSeq( decoder_t *, subpicture_t *, subpicture_data_t *,
...@@ -277,15 +279,15 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu, ...@@ -277,15 +279,15 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_spu->i_x = (p_sys->buffer[i_index+1]<<4)| p_spu_properties->i_x = (p_sys->buffer[i_index+1]<<4)|
((p_sys->buffer[i_index+2]>>4)&0x0f); ((p_sys->buffer[i_index+2]>>4)&0x0f);
p_spu_properties->i_width = (((p_sys->buffer[i_index+2]&0x0f)<<8)| p_spu_properties->i_width = (((p_sys->buffer[i_index+2]&0x0f)<<8)|
p_sys->buffer[i_index+3]) - p_spu->i_x + 1; p_sys->buffer[i_index+3]) - p_spu_properties->i_x + 1;
p_spu->i_y = (p_sys->buffer[i_index+4]<<4)| p_spu_properties->i_y = (p_sys->buffer[i_index+4]<<4)|
((p_sys->buffer[i_index+5]>>4)&0x0f); ((p_sys->buffer[i_index+5]>>4)&0x0f);
p_spu_properties->i_height = (((p_sys->buffer[i_index+5]&0x0f)<<8)| p_spu_properties->i_height = (((p_sys->buffer[i_index+5]&0x0f)<<8)|
p_sys->buffer[i_index+6]) - p_spu->i_y + 1; p_sys->buffer[i_index+6]) - p_spu_properties->i_y + 1;
/* Auto crop fullscreen subtitles */ /* Auto crop fullscreen subtitles */
if( p_spu_properties->i_height > 250 ) if( p_spu_properties->i_height > 250 )
...@@ -672,8 +674,8 @@ static void Render( decoder_t *p_dec, subpicture_t *p_spu, ...@@ -672,8 +674,8 @@ static void Render( decoder_t *p_dec, subpicture_t *p_spu,
return; return;
} }
p_spu->p_region->i_x = 0; p_spu->p_region->i_x = p_spu_properties->i_x;
p_spu->p_region->i_y = p_spu_data->i_y_top_offset; p_spu->p_region->i_y = p_spu_properties->i_y + p_spu_data->i_y_top_offset;
p_p = p_spu->p_region->picture.p->p_pixels; p_p = p_spu->p_region->picture.p->p_pixels;
i_pitch = p_spu->p_region->picture.p->i_pitch; i_pitch = p_spu->p_region->picture.p->i_pitch;
......
...@@ -127,8 +127,8 @@ void ParseSSAString( decoder_t *p_dec, ...@@ -127,8 +127,8 @@ void ParseSSAString( decoder_t *p_dec,
if( p_style == NULL ) if( p_style == NULL )
{ {
p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0; p_spu->p_region->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10; p_spu->p_region->i_y = 10;
} }
else else
{ {
...@@ -137,13 +137,13 @@ void ParseSSAString( decoder_t *p_dec, ...@@ -137,13 +137,13 @@ void ParseSSAString( decoder_t *p_dec,
p_spu->p_region->i_align = p_style->i_align; p_spu->p_region->i_align = p_style->i_align;
if( p_style->i_align & SUBPICTURE_ALIGN_LEFT ) if( p_style->i_align & SUBPICTURE_ALIGN_LEFT )
{ {
p_spu->i_x = (i_margin_l) ? i_margin_l : p_style->i_margin_h; p_spu->p_region->i_x = (i_margin_l) ? i_margin_l : p_style->i_margin_h;
} }
else if( p_style->i_align & SUBPICTURE_ALIGN_RIGHT ) else if( p_style->i_align & SUBPICTURE_ALIGN_RIGHT )
{ {
p_spu->i_x = (i_margin_r) ? i_margin_r : p_style->i_margin_h; p_spu->p_region->i_x = (i_margin_r) ? i_margin_r : p_style->i_margin_h;
} }
p_spu->i_y = (i_margin_v) ? i_margin_v : p_style->i_margin_v; p_spu->p_region->i_y = (i_margin_v) ? i_margin_v : p_style->i_margin_v;
} }
} }
......
...@@ -427,8 +427,8 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block ) ...@@ -427,8 +427,8 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
{ {
/* Normal text subs, easy markup */ /* Normal text subs, easy markup */
p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0; p_spu->p_region->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10; p_spu->p_region->i_y = 10;
/* Remove formatting from string */ /* Remove formatting from string */
...@@ -616,8 +616,8 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle ) ...@@ -616,8 +616,8 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
/* Check for forced alignment */ /* Check for forced alignment */
if( !strncmp( psz_subtitle, "{\\an", 4 ) && psz_subtitle[4] >= '1' && psz_subtitle[4] <= '9' && psz_subtitle[5] == '}' ) if( !strncmp( psz_subtitle, "{\\an", 4 ) && psz_subtitle[4] >= '1' && psz_subtitle[4] <= '9' && psz_subtitle[5] == '}' )
{ {
static const pi_vertical[3] = { SUBPICTURE_ALIGN_BOTTOM, 0, SUBPICTURE_ALIGN_TOP }; static const int pi_vertical[3] = { SUBPICTURE_ALIGN_BOTTOM, 0, SUBPICTURE_ALIGN_TOP };
static const pi_horizontal[3] = { SUBPICTURE_ALIGN_LEFT, 0, SUBPICTURE_ALIGN_RIGHT }; static const int pi_horizontal[3] = { SUBPICTURE_ALIGN_LEFT, 0, SUBPICTURE_ALIGN_RIGHT };
const int i_id = psz_subtitle[4] - '1'; const int i_id = psz_subtitle[4] - '1';
*pi_align = pi_vertical[i_id/3] | pi_horizontal[i_id%3]; *pi_align = pi_vertical[i_id/3] | pi_horizontal[i_id%3];
......
...@@ -473,8 +473,6 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data ) ...@@ -473,8 +473,6 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
p_spu = p_dec->pf_spu_buffer_new( p_dec ); p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL; if( !p_spu ) return NULL;
p_spu->i_x = p_sys->i_x_start;
p_spu->i_y = p_sys->i_y_start;
p_spu->i_start = p_data->i_pts; p_spu->i_start = p_data->i_pts;
p_spu->i_stop = p_data->i_pts + p_sys->i_duration; p_spu->i_stop = p_data->i_pts + p_sys->i_duration;
p_spu->b_ephemer = true; p_spu->b_ephemer = true;
...@@ -506,7 +504,8 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data ) ...@@ -506,7 +504,8 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
p_region->fmt.i_aspect = VOUT_ASPECT_FACTOR; p_region->fmt.i_aspect = VOUT_ASPECT_FACTOR;
p_spu->p_region = p_region; p_spu->p_region = p_region;
p_region->i_x = p_region->i_y = 0; p_region->i_x = p_sys->i_x_start;
p_region->i_y = p_sys->i_y_start;
/* Build palette */ /* Build palette */
fmt.p_palette->i_entries = 4; fmt.p_palette->i_entries = 4;
......
...@@ -717,10 +717,10 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) ...@@ -717,10 +717,10 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
/* Normal text subs, easy markup */ /* Normal text subs, easy markup */
p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0; p_spu->p_region->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10; p_spu->p_region->i_y = 10;
p_spu->p_region->psz_text = strdup(psz_text); p_spu->p_region->psz_text = strdup(psz_text);
p_spu->i_start = p_block->i_pts; p_spu->i_start = p_block->i_pts;
p_spu->i_stop = p_block->i_pts + p_block->i_length; p_spu->i_stop = p_block->i_pts + p_block->i_length;
p_spu->b_ephemer = (p_block->i_length == 0); p_spu->b_ephemer = (p_block->i_length == 0);
......
...@@ -495,9 +495,6 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt, ...@@ -495,9 +495,6 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
p_spu->p_region->i_y = 0; p_spu->p_region->i_y = 0;
p_spu->p_region->i_align = i_align; p_spu->p_region->i_align = i_align;
/* Normal text subs, easy markup */
p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM;
p_spu->i_start = i_pts; p_spu->i_start = i_pts;
p_spu->i_stop = 0; p_spu->i_stop = 0;
p_spu->b_ephemer = true; p_spu->b_ephemer = true;
......
...@@ -337,9 +337,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) ...@@ -337,9 +337,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
return NULL; return NULL;
} }
p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->b_absolute = true; p_spu->b_absolute = true;
p_spu->i_start = date; p_spu->i_start = date;
p_spu->i_stop = 0; p_spu->i_stop = 0;
......
...@@ -888,8 +888,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) ...@@ -888,8 +888,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_spu->b_absolute = false; p_spu->b_absolute = false;
} }
p_spu->i_x = p_sys->posx; p_region->i_x = p_sys->posx;
p_spu->i_y = p_sys->posy; p_region->i_y = p_sys->posy;
p_spu->p_region = p_region; p_spu->p_region = p_region;
......
...@@ -317,8 +317,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) ...@@ -317,8 +317,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_spu->b_absolute = false; p_spu->b_absolute = false;
} }
p_spu->i_x = p_sys->i_xoff; p_spu->p_region->i_x = p_sys->i_xoff;
p_spu->i_y = p_sys->i_yoff; p_spu->p_region->i_y = p_sys->i_yoff;
p_spu->p_region->p_style = p_sys->p_style; p_spu->p_region->p_style = p_sys->p_style;
......
...@@ -458,7 +458,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) ...@@ -458,7 +458,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_spu->i_stop = 0; p_spu->i_stop = 0;
p_spu->b_ephemer = true; p_spu->b_ephemer = true;
p_spu->i_alpha = p_sys->i_alpha; p_spu->i_alpha = p_sys->i_alpha;
p_spu->i_flags = p_sys->i_align;
p_spu->b_absolute = false; p_spu->b_absolute = false;
vlc_mutex_lock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
......
...@@ -451,6 +451,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date ) ...@@ -451,6 +451,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date )
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
subpicture_t *p_spu = NULL; subpicture_t *p_spu = NULL;
subpicture_region_t *p_region = NULL; subpicture_region_t *p_region = NULL;
int i_x, i_y;
if( !p_sys->b_update || (p_sys->i_update <= 0) ) if( !p_sys->b_update || (p_sys->i_update <= 0) )
return NULL; return NULL;
...@@ -472,7 +473,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date ) ...@@ -472,7 +473,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date )
p_spu->b_absolute = true; p_spu->b_absolute = true;
else else
p_spu->b_absolute = p_sys->b_absolute; p_spu->b_absolute = p_sys->b_absolute;
p_spu->i_flags = p_sys->i_position;
/* Determine the duration of the subpicture */ /* Determine the duration of the subpicture */
if( p_sys->i_end_date > 0 ) if( p_sys->i_end_date > 0 )
...@@ -505,8 +505,11 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date ) ...@@ -505,8 +505,11 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date )
NULL ); NULL );
/* proper positioning of OSD menu image */ /* proper positioning of OSD menu image */
p_spu->i_x = p_filter->p_sys->p_menu->p_state->i_x; p_region->i_x = p_filter->p_sys->p_menu->p_state->i_x;
p_spu->i_y = p_filter->p_sys->p_menu->p_state->i_y; p_region->i_y = p_filter->p_sys->p_menu->p_state->i_y;
/* FIXME is it needed ?
p_region->i_align = p_sys->i_position;
*/
p_spu->p_region = p_region; p_spu->p_region = p_region;
p_spu->i_alpha = 0xFF; /* Picture is completely non transparent. */ p_spu->i_alpha = 0xFF; /* Picture is completely non transparent. */
return p_spu; return p_spu;
...@@ -535,14 +538,16 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date ) ...@@ -535,14 +538,16 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date )
/* proper positioning of OSD menu image */ /* proper positioning of OSD menu image */
if( p_filter->p_sys->p_menu->i_style == OSD_MENU_STYLE_CONCAT ) if( p_filter->p_sys->p_menu->i_style == OSD_MENU_STYLE_CONCAT )
{ {
p_spu->i_x = p_filter->p_sys->p_menu->p_button->i_x; i_x = p_filter->p_sys->p_menu->p_button->i_x;
p_spu->i_y = p_filter->p_sys->p_menu->p_button->i_y; i_y = p_filter->p_sys->p_menu->p_button->i_y;
} }
else else
{ {
p_spu->i_x = p_filter->p_sys->p_menu->p_state->i_x; i_x = p_filter->p_sys->p_menu->p_state->i_x;
p_spu->i_y = p_filter->p_sys->p_menu->p_state->i_y; i_y = p_filter->p_sys->p_menu->p_state->i_y;
} }
p_region->i_x = i_x;
p_region->i_y = i_y;
if( p_filter->p_sys->p_menu->i_style == OSD_MENU_STYLE_CONCAT ) if( p_filter->p_sys->p_menu->i_style == OSD_MENU_STYLE_CONCAT )
{ {
...@@ -582,8 +587,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date ) ...@@ -582,8 +587,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t i_date )
} }
else else
{ {
p_new->i_x = p_region_tail->fmt.i_visible_width; p_new->i_x = i_x+p_region_tail->fmt.i_visible_width;
p_new->i_y = p_button->i_y; p_new->i_y = i_y+p_button->i_y;
p_region_tail->p_next = p_new; p_region_tail->p_next = p_new;
p_region_tail = p_new; p_region_tail = p_new;
} }
......
...@@ -1182,8 +1182,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) ...@@ -1182,8 +1182,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_spu->b_absolute = false; p_spu->b_absolute = false;
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->i_original_picture_width = 0; /*Let vout core do the horizontal scaling */ p_spu->i_original_picture_width = 0; /*Let vout core do the horizontal scaling */
p_spu->i_original_picture_height =