[vlc-devel] commit: Fixed picture cache creation. (Laurent Aimar )

git version control git at videolan.org
Wed Sep 17 19:11:30 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Sep 17 00:18:49 2008 +0200| [7c73eafc1949d1ba2806c572c0e3e54086383f53] | committer: Laurent Aimar 

Fixed picture cache creation.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c73eafc1949d1ba2806c572c0e3e54086383f53
---

 src/video_output/vout_subpictures.c |   38 ++++++++++++++++------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 1add8d0..cf2ebfb 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -790,18 +790,10 @@ static void SpuRenderRegion( spu_t *p_spu,
             p_scale->fmt_in.video = p_region->fmt;
             p_scale->fmt_out.video = p_region->fmt;
 
-            p_region->p_cache =
-                p_subpic->pf_create_region( VLC_OBJECT(p_spu),
-                                            &p_scale->fmt_out.video );
-            p_region->p_cache->p_next = p_region->p_next;
-
             if( p_scale->fmt_out.video.p_palette )
                 *p_scale->fmt_out.video.p_palette =
                     *p_region->fmt.p_palette;
 
-            vout_CopyPicture( p_spu, &p_region->p_cache->picture,
-                              &p_region->picture );
-
             p_scale->fmt_out.video.i_width = i_dst_width;
             p_scale->fmt_out.video.i_height = i_dst_height;
 
@@ -810,29 +802,36 @@ static void SpuRenderRegion( spu_t *p_spu,
             p_scale->fmt_out.video.i_visible_height =
                 spu_scale_h( p_region->fmt.i_visible_height, scale_size );
 
-            p_region->p_cache->fmt = p_scale->fmt_out.video;
-            p_region->p_cache->i_x = spu_scale_w( p_region->i_x, scale_size );
-            p_region->p_cache->i_y = spu_scale_h( p_region->i_y, scale_size );
-            p_region->p_cache->i_align = p_region->i_align;
-            p_region->p_cache->i_alpha = p_region->i_alpha;
+            p_region->p_cache =
+                p_subpic->pf_create_region( VLC_OBJECT(p_spu),
+                                            &p_scale->fmt_out.video );
 
             p_pic = NULL;
             if( p_scale->p_module )
-                p_pic = p_scale->pf_video_filter( p_scale, &p_region->p_cache->picture );
-            else
-                msg_Err( p_spu, "scaling failed (module not loaded)" );
-
+            {
+                picture_t picture = p_region->picture;
+                picture.pf_release = NULL;  /* That's an ugly hack */
+                p_pic = p_scale->pf_video_filter( p_scale, &picture );
+            }
             if( p_pic )
             {
-                p_region->p_cache->picture = *p_pic;
-                free( p_pic );
+                picture_Copy( &p_region->p_cache->picture, p_pic );
+                picture_Release( p_pic );
+
+                p_region->p_cache->fmt = p_scale->fmt_out.video;
+                p_region->p_cache->i_x = spu_scale_w( p_region->i_x, scale_size );
+                p_region->p_cache->i_y = spu_scale_h( p_region->i_y, scale_size );
+                p_region->p_cache->i_align = p_region->i_align;
+                p_region->p_cache->i_alpha = p_region->i_alpha;
             }
             else
             {
+                msg_Err( p_spu, "scaling failed (module not loaded)" );
                 p_subpic->pf_destroy_region( VLC_OBJECT(p_spu),
                                              p_region->p_cache );
                 p_region->p_cache = NULL;
             }
+
         }
 
         /* And use the scaled picture */
@@ -970,7 +969,6 @@ void spu_RenderSubpictures( spu_t *p_spu,
         return;
     }
 
-
     /* */
     for( p_subpic = p_subpic_list;
             p_subpic != NULL && p_subpic->i_status != FREE_SUBPICTURE; /* Check again status (as we where unlocked) */




More information about the vlc-devel mailing list