[vlc-commits] commit: Improved SpuRenderSubpictures() output region linking. ( Laurent Aimar )
git at videolan.org
git at videolan.org
Sun Jan 9 22:44:22 CET 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Dec 19 14:19:30 2010 +0100| [cb77eb08fa8c537e3ce020e1e664e8bb41c219c9] | committer: Laurent Aimar
Improved SpuRenderSubpictures() output region linking.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cb77eb08fa8c537e3ce020e1e664e8bb41c219c9
---
src/video_output/vout_subpictures.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 5f86fc8..08928ff 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1060,6 +1060,12 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu,
if( i_region_count <= 0 )
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 */
spu_area_t p_subtitle_area_buffer[VOUT_MAX_SUBPICTURES];
spu_area_t *p_subtitle_area;
@@ -1073,7 +1079,6 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu,
/* 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_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++ )
{
subpicture_t *p_subpic = pp_subpicture[i_index];
@@ -1146,19 +1151,14 @@ static subpicture_t *SpuRenderSubpictures( spu_t *p_spu,
continue;
/* */
- subpicture_region_t *p_render;
- SpuRenderRegion( p_spu, &p_render, &area,
+ SpuRenderRegion( p_spu, pp_output_last, &area,
p_subpic, p_region, scale,
p_chroma_list, p_fmt_dst,
p_subtitle_area, i_subtitle_area,
p_subpic->b_subtitle ? render_subtitle_date : render_osd_date );
- if( p_render )
- {
- subpicture_region_t **pp_last = &p_output->p_region;
- while( *pp_last )
- pp_last = &(*pp_last)->p_next;
- *pp_last = p_render;
- }
+
+ if( *pp_output_last )
+ pp_output_last = &(*pp_output_last)->p_next;
if( p_subpic->b_subtitle )
{
More information about the vlc-commits
mailing list