Commit cb77eb08 authored by Laurent Aimar's avatar Laurent Aimar

Improved SpuRenderSubpictures() output region linking.

parent d2c08925
...@@ -1060,6 +1060,12 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu, ...@@ -1060,6 +1060,12 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu,
if( i_region_count <= 0 ) if( i_region_count <= 0 )
return NULL; return NULL;
/* Create the output subpicture */
subpicture_t *p_output = subpicture_New( NULL );
if( !p_output )
return NULL;
subpicture_region_t **pp_output_last = &p_output->p_region;
/* Allocate area array for subtitle overlap */ /* Allocate area array for subtitle overlap */
spu_area_t p_subtitle_area_buffer[VOUT_MAX_SUBPICTURES]; spu_area_t p_subtitle_area_buffer[VOUT_MAX_SUBPICTURES];
spu_area_t *p_subtitle_area; spu_area_t *p_subtitle_area;
...@@ -1073,7 +1079,6 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu, ...@@ -1073,7 +1079,6 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu,
/* Process all subpictures and regions (in the right order) */ /* Process all subpictures and regions (in the right order) */
const int i_source_video_width = p_fmt_src->i_width; const int i_source_video_width = p_fmt_src->i_width;
const int i_source_video_height = p_fmt_src->i_height; const int i_source_video_height = p_fmt_src->i_height;
subpicture_t *p_output = subpicture_New( NULL );
for( unsigned int i_index = 0; i_index < i_subpicture; i_index++ ) for( unsigned int i_index = 0; i_index < i_subpicture; i_index++ )
{ {
subpicture_t *p_subpic = pp_subpicture[i_index]; subpicture_t *p_subpic = pp_subpicture[i_index];
...@@ -1146,19 +1151,14 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu, ...@@ -1146,19 +1151,14 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu,
continue; continue;
/* */ /* */
subpicture_region_t *p_render; SpuRenderRegion( p_spu, pp_output_last, &area,
SpuRenderRegion( p_spu, &p_render, &area,
p_subpic, p_region, scale, p_subpic, p_region, scale,
p_chroma_list, p_fmt_dst, p_chroma_list, p_fmt_dst,
p_subtitle_area, i_subtitle_area, p_subtitle_area, i_subtitle_area,
p_subpic->b_subtitle ? render_subtitle_date : render_osd_date ); p_subpic->b_subtitle ? render_subtitle_date : render_osd_date );
if( p_render )
{ if( *pp_output_last )
subpicture_region_t **pp_last = &p_output->p_region; pp_output_last = &(*pp_output_last)->p_next;
while( *pp_last )
pp_last = &(*pp_last)->p_next;
*pp_last = p_render;
}
if( p_subpic->b_subtitle ) if( p_subpic->b_subtitle )
{ {
......
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