[vlc-devel] [PATCH 15/23] display: keep the video context to feed the converter locally

Steve Lhomme robux4 at ycbcr.xyz
Thu Nov 7 10:31:28 CET 2019


---
 src/video_output/display.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 277d6f6dc11..083699cf65e 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -278,6 +278,7 @@ typedef struct {
 
     /* */
     video_format_t source;
+    vlc_video_context *src_vctx;
      /* filters to convert the vout source to fmt, NULL means no conversion
       * can be done and nothing will be displayed */
     filter_chain_t *converters;
@@ -749,6 +750,8 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
     osys->crop.num = 0;
     osys->crop.den = 0;
 
+    osys->src_vctx = vctx ? vlc_video_context_Hold( vctx ) : NULL;
+
     /* */
     vout_display_t *vd = &osys->display;
     video_format_Copy(&vd->source, source);
@@ -765,7 +768,7 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
 
     if (vlc_module_load(vd, "vout display", module, module && *module != '\0',
                         vout_display_start, vd, &osys->cfg,
-                        vctx) == NULL)
+                        osys->src_vctx) == NULL)
         goto error;
 
 #if defined(__OS2__)
@@ -798,6 +801,12 @@ void vout_display_Delete(vout_display_t *vd)
 {
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
 
+    if (osys->src_vctx)
+    {
+        vlc_video_context_Release( osys->src_vctx );
+        osys->src_vctx = NULL;
+    }
+
     if (osys->converters != NULL)
         filter_chain_Delete(osys->converters);
 
-- 
2.17.1



More information about the vlc-devel mailing list