resource: do not keep the free vout as free when it's going to be reused
authorSteve Lhomme <robux4@ycbcr.xyz>
Tue, 7 Jan 2020 10:52:00 +0000 (11:52 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Thu, 9 Jan 2020 09:53:07 +0000 (10:53 +0100)
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

index a0dfbc3..4ff6edd 100644 (file)
@@ -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;
+        /* the caller is going to reuse the free vout, it's not free anymore */
+        if (p_resource->p_vout_free == cfg->vout)
+            p_resource->p_vout_free = NULL;
         vlc_mutex_unlock(&p_resource->lock_hold);
     }