[vlc-devel] [PATCH] resource: do not keep the free vout as free when it's going to be reused

Steve Lhomme robux4 at ycbcr.xyz
Tue Jan 7 12:18:04 CET 2020


Calling input_resource_GetVoutDecoderDevice() with a known vout means it's
going to be used and thus it's not free anymore.

This prevents the es_out to release the vout when the decoder has actually
reused it.
---
 src/input/resource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/input/resource.c b/src/input/resource.c
index a0dfbc3a687..91ea4a31050 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -410,6 +410,9 @@ vout_thread_t *input_resource_GetVoutDecoderDevice(input_resource_t *p_resource,
         assert(p_resource->i_vout > 0);
         *order = p_resource->pp_vout[0] == cfg->vout ? VLC_VOUT_ORDER_PRIMARY
                                                      : VLC_VOUT_ORDER_SECONDARY;
+        assert(p_resource->p_vout_free == NULL || p_resource->p_vout_free == cfg->vout);
+        /* the caller is going to reuse the free vout, it's not free anymore */
+        p_resource->p_vout_free = NULL;
         vlc_mutex_unlock(&p_resource->lock_hold);
     }
 
-- 
2.17.1



More information about the vlc-devel mailing list