[vlc-devel] [PATCH] video_output: display: don't pass a video format to the loader

Thomas Guillem thomas at gllm.fr
Tue Nov 5 14:59:51 CET 2019


OK

On Mon, Nov 4, 2019, at 16:45, Steve Lhomme wrote:
> Also the vd->source is passed without a SAR when loading the module but 
> the module can read the SAR from vd->source anytime so it may be totally 
> useless to pass a cleaned vd->source in the first place.
> 
> On 2019-11-04 16:30, Steve Lhomme wrote:
> > It's part of vd that is already passed to the module loader.
> > ---
> >   src/video_output/display.c | 13 ++++++-------
> >   1 file changed, 6 insertions(+), 7 deletions(-)
> > 
> > diff --git a/src/video_output/display.c b/src/video_output/display.c
> > index 99843fb2bfe..f5742295a52 100644
> > --- a/src/video_output/display.c
> > +++ b/src/video_output/display.c
> > @@ -70,18 +70,17 @@ static int vout_display_start(void *func, bool forced, va_list ap)
> >       vout_display_open_cb activate = func;
> >       vout_display_t *vd = va_arg(ap, vout_display_t *);
> >       const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
> > -    video_format_t *fmtp = va_arg(ap, video_format_t *);
> >       vlc_video_context *context = va_arg(ap, vlc_video_context *);
> >   
> >       /* Picture buffer does not have the concept of aspect ratio */
> > -    video_format_Copy(fmtp, &vd->source);
> > -    fmtp->i_sar_num = 0;
> > -    fmtp->i_sar_den = 0;
> > +    video_format_Copy(&vd->fmt, &vd->source);
> > +    vd->fmt.i_sar_num = 0;
> > +    vd->fmt.i_sar_den = 0;
> >       vd->obj.force = forced; /* TODO: pass to activate() instead? */
> >   
> > -    int ret = activate(vd, cfg, fmtp, context);
> > +    int ret = activate(vd, cfg, &vd->fmt, context);
> >       if (ret != VLC_SUCCESS) {
> > -        video_format_Clean(fmtp);
> > +        video_format_Clean(&vd->fmt);
> >           vlc_objres_clear(VLC_OBJECT(vd));
> >       }
> >       return ret;
> > @@ -765,7 +764,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, &vd->fmt,
> > +                        vout_display_start, vd, &osys->cfg,
> >                           vctx) == NULL)
> >           goto error;
> >   
> > -- 
> > 2.17.1
> > 
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> > 
> _______________________________________________
> 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