[vlc-devel] [PATCH 24/42] vout: robustify "early" SPU blending
    Rémi Denis-Courmont 
    remi at remlab.net
       
    Fri Jun 28 20:30:12 CEST 2013
    
    
  
If the picture copy fails or blending is unavailable(1), discard only
the subpicture and keep the original picture.
(1) In practice, this never happens as the blender object is kept
all the time even without a "blend" module.
---
 src/video_output/video_output.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index d2a898d..26eca24 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -971,19 +971,19 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
     bool is_direct = vout->p->decoder_pool == vout->p->display_pool;
     picture_t *todisplay = filtered;
     if (do_early_spu && subpic) {
-        todisplay = picture_pool_Get(vout->p->private_pool);
-        if (todisplay) {
-            VideoFormatCopyCropAr(&todisplay->format, &filtered->format);
-            picture_Copy(todisplay, filtered);
-            if (vout->p->spu_blend)
-                picture_BlendSubpicture(todisplay, vout->p->spu_blend, subpic);
+        picture_t *blent = picture_pool_Get(vout->p->private_pool);
+        if (blent) {
+            VideoFormatCopyCropAr(&blent->format, &filtered->format);
+            picture_Copy(blent, filtered);
+            if (vout->p->spu_blend) {
+                picture_BlendSubpicture(blent, vout->p->spu_blend, subpic);
+                picture_Release(todisplay);
+                todisplay = blent;
+            } else
+                picture_Release(blent);
         }
-        picture_Release(filtered);
         subpicture_Delete(subpic);
         subpic = NULL;
-
-        if (!todisplay)
-            return VLC_EGENERIC;
     }
 
     assert(vout_IsDisplayFiltered(vd) == !sys->display.use_dr);
-- 
1.8.3.1
    
    
More information about the vlc-devel
mailing list