[vlc-devel] [PATCH 3/3] video_output: remove the private pool

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 13 14:13:07 CEST 2020


---
 src/video_output/video_output.c |  3 +--
 src/video_output/vout_private.h |  1 -
 src/video_output/vout_wrapper.c | 30 +++++-------------------------
 3 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index dc636d72928..ede211f10b6 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1710,7 +1710,6 @@ static int vout_Start(vout_thread_sys_t *vout, vlc_video_context *vctx, const vo
 
     sys->decoder_fifo = picture_fifo_New();
     sys->private.display_pool = NULL;
-    sys->private.private_pool = NULL;
 
     sys->filter.configuration = NULL;
     video_format_Copy(&sys->filter.src_fmt, &sys->original);
@@ -1791,7 +1790,7 @@ static int vout_Start(vout_thread_sys_t *vout, vlc_video_context *vctx, const vo
         vout_SetDisplayAspect(sys->display, num, den);
     vlc_mutex_unlock(&sys->display_lock);
 
-    assert(sys->private.display_pool != NULL && sys->private.private_pool != NULL);
+    assert(sys->private.display_pool != NULL);
 
     sys->displayed.current       = NULL;
     sys->displayed.next          = NULL;
diff --git a/src/video_output/vout_private.h b/src/video_output/vout_private.h
index 261dcc30fe4..cb4c0bde6a8 100644
--- a/src/video_output/vout_private.h
+++ b/src/video_output/vout_private.h
@@ -43,7 +43,6 @@ struct vout_thread_private_t
         vlc_tick_t  date;
     } interlacing;
 
-    picture_pool_t  *private_pool;
     picture_pool_t  *display_pool;
 };
 
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 6445f99b7a2..6e751f4c238 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -79,39 +79,20 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout, vout_thread_private_t *sys
     if (vd == NULL)
         return NULL;
 
-    sys->display_pool = NULL;
-
-    const unsigned private_picture  = 4; /* XXX 3 for filter, 1 for SPU */
     const unsigned kept_picture     = 1; /* last displayed picture */
     const unsigned reserved_picture = DISPLAY_PICTURE_COUNT +
-                                      private_picture +
                                       kept_picture;
 
-    picture_pool_t *display_pool = vout_GetPool(vd, reserved_picture);
-    if (display_pool == NULL)
+    sys->display_pool = vout_GetPool(vd, reserved_picture);
+    if (sys->display_pool == NULL)
         goto error;
 
 #ifndef NDEBUG
-    if ( picture_pool_GetSize(display_pool) < reserved_picture )
+    if ( picture_pool_GetSize(sys->display_pool) < reserved_picture )
         msg_Warn(vout, "Not enough display buffers in the pool, requested %u got %u",
-                 reserved_picture, picture_pool_GetSize(display_pool));
+                 reserved_picture, picture_pool_GetSize(sys->display_pool));
 #endif
 
-    if (!vout_IsDisplayFiltered(vd) &&
-        picture_pool_GetSize(display_pool) >= reserved_picture) {
-        sys->private_pool = picture_pool_Reserve(display_pool, private_picture);
-    } else {
-        sys->private_pool =
-            picture_pool_NewFromFormat(&vd->source,
-                                       __MAX(VOUT_MAX_PICTURES,
-                                             reserved_picture - DISPLAY_PICTURE_COUNT));
-    }
-    if (sys->private_pool == NULL) {
-        picture_pool_Release(display_pool);
-        goto error;
-    }
-    sys->display_pool = display_pool;
-
 #ifdef _WIN32
     var_Create(vout, "video-wallpaper", VLC_VAR_BOOL|VLC_VAR_DOINHERIT);
     var_AddCallback(vout, "video-wallpaper", Forward, vd);
@@ -130,9 +111,8 @@ error:
  *****************************************************************************/
 void vout_CloseWrapper(vout_thread_t *vout, vout_thread_private_t *sys, vout_display_t *vd)
 {
-    assert(sys->display_pool && sys->private_pool);
+    assert(sys->display_pool);
 
-    picture_pool_Release(sys->private_pool);
     sys->display_pool = NULL;
 
 #ifdef _WIN32
-- 
2.26.2



More information about the vlc-devel mailing list