[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
Wed Jan 8 08:03:36 CET 2020
Replaces https://patches.videolan.org/patch/25912/
The assert wasn't right given the code just above it. The cfg->vout
could be a secondary vout which is not the free vout. In that case the
free vout (which should only be the primary one) shouldn't be touched.
On 2020-01-08 8:01, Steve Lhomme wrote:
> 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..4ff6edd79c0 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;
> + /* 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);
> }
>
> --
> 2.17.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list