[vlc-commits] vout: robustify "early" SPU blending

Rémi Denis-Courmont git at videolan.org
Sun Jul 7 20:13:39 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 22 21:18:44 2013 +0300| [8708b1d80b56031c54e9b939909822edb2e462dc] | committer: Rémi Denis-Courmont

vout: robustify "early" SPU blending

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.

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

 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);



More information about the vlc-commits mailing list