[vlc-devel] [PATCH] display: only pass the vout_display_priv_t to vout_display_start()

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 27 08:30:03 CEST 2020


>   /* */
>   void vout_display_GetDefaultDisplaySize(unsigned *width, unsigned *height,
>                                           const video_format_t *source,
> @@ -311,6 +290,26 @@ typedef struct {
>       picture_pool_t *pool;
>   } vout_display_priv_t;
>   
> +static int vout_display_start(void *func, bool forced, va_list ap)
> +{
> +    vout_display_open_cb activate = func;
> +    vout_display_priv_t *osys = va_arg(ap, vout_display_priv_t *);
> +    vout_display_t *vd = &osys->display;
> +
> +    /* Picture buffer does not have the concept of aspect ratio */
> +    video_format_Copy(&vd->fmt, &vd->source);
> +    vd->fmt.i_sar_num = 0;
> +    vd->fmt.i_sar_den = 0;

BTW, anyone remember why this is needed ?

> +    vd->obj.force = forced; /* TODO: pass to activate() instead? */
> +
> +    int ret = activate(vd, &osys->cfg, &vd->fmt, osys->src_vctx);
> +    if (ret != VLC_SUCCESS) {
> +        video_format_Clean(&vd->fmt);
> +        vlc_objres_clear(VLC_OBJECT(vd));
> +    }
> +    return ret;
> +}
> +
>   static vlc_decoder_device * DisplayHoldDecoderDevice(vlc_object_t *o, void *sys)
>   {
>       VLC_UNUSED(o);
> @@ -785,8 +784,7 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
>           vd->owner = *owner;
>   
>       if (vlc_module_load(vd, "vout display", module, module && *module != '\0',
> -                        vout_display_start, vd, &osys->cfg,
> -                        osys->src_vctx) == NULL)
> +                        vout_display_start, osys) == NULL)
>           goto error;
>   
>   #if defined(__OS2__)
> -- 
> 2.26.2
> 
> _______________________________________________
> 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