[vlc-commits] vout_wrapper: only retain display_pool if needed

Rémi Denis-Courmont git at videolan.org
Wed Dec 26 13:31:55 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 26 13:48:05 2018 +0200| [2704914d4f52852e85639fe48a212cdca7d444e5] | committer: Rémi Denis-Courmont

vout_wrapper: only retain display_pool if needed

The display pool is only used by the video output core in the corner
case whereby pictures must be copied but not converted.

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

 src/video_output/video_output.c | 6 ++----
 src/video_output/vout_wrapper.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0eff39f890..f2ea817e1a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1153,10 +1153,8 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
         subpic = NULL;
     }
 
-    if (sys->display.use_copy) {
-        picture_t *direct = NULL;
-        if (likely(sys->display_pool != NULL))
-            direct = picture_pool_Get(sys->display_pool);
+    if (sys->display_pool != NULL) {
+        picture_t *direct = picture_pool_Get(sys->display_pool);
         if (!direct) {
             picture_Release(todisplay);
             if (subpic)
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 94d348c347..438927c476 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -70,6 +70,7 @@ int vout_OpenWrapper(vout_thread_t *vout,
         return VLC_EGENERIC;
 
     sys->decoder_pool = NULL;
+    sys->display_pool = NULL;
 
     const bool use_dr = !vout_IsDisplayFiltered(vd);
     const bool allow_dr = !vd->info.has_pictures_invalid && !vd->info.is_slow && use_dr;
@@ -98,7 +99,6 @@ int vout_OpenWrapper(vout_thread_t *vout,
         sys->display.use_copy = false;
         sys->dpb_size     = picture_pool_GetSize(display_pool) - reserved_picture;
         sys->decoder_pool = display_pool;
-        sys->display_pool = display_pool;
     } else {
         sys->display.use_copy = use_dr;
         sys->decoder_pool = decoder_pool =
@@ -115,14 +115,12 @@ int vout_OpenWrapper(vout_thread_t *vout,
         }
         if (use_dr)
             sys->display_pool = vout_GetPool(vd, 3);
-        else
-            sys->display_pool = NULL;
     }
     sys->private_pool = picture_pool_Reserve(sys->decoder_pool, private_picture);
     if (sys->private_pool == NULL) {
         if (decoder_pool != NULL)
             picture_pool_Release(decoder_pool);
-        sys->display_pool = sys->decoder_pool = NULL;
+        sys->decoder_pool = NULL;
         goto error;
     }
 



More information about the vlc-commits mailing list