[vlc-devel] [PATCH] decoder: don't request a vout in loop

Thomas Guillem thomas at gllm.fr
Mon Sep 26 09:11:21 CEST 2016


On Sat, Sep 24, 2016, at 01:26, remi at remlab.net wrote:
> Hello,
>
> Le 23 sept. 2016 11:16, Thomas Guillem <thomas at gllm.fr> a écrit :
> >
> > Don't try to request a vout if it previously failed. A new vout
> > will be
> > requested if the fmt_out changes. This save a *lot* of CPU cycles
> > when playing
> > a sample with an invalid fmt_out.
>
> It does if the decoder changes the format at every buffer allocation.
> But I understood you would fix that?

I never saw that case. If this case happen, is it not the fault of
the module ?

> Then there is not much to save anymore - and it breaks the corner case
> where vout creation fails before it "somehow" succeeds.
Can this really happen ? A vout that succeed after a fail when the dec-
>fmt_out doesn't change at all ?

> I would rather decouple format change and picture allocation first.
> Then re-evaluate whether this patch still makes sense.

Then, do you agree with my patch set "[PATCH 0/3] decoder: don't update
format when creating a buffer" ?
I can do it for audio and video.

>
> > ---
> > src/input/decoder.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/input/decoder.c b/src/input/decoder.c
> > index a736143..d44789e 100644
> > --- a/src/input/decoder.c
> > +++ b/src/input/decoder.c
> > @@ -369,8 +369,7 @@ static int vout_update_format( decoder_t
> > *p_dec )
> > {
> >      decoder_owner_sys_t *p_owner = p_dec->p_owner;
> >
> > -    if( p_owner->p_vout == NULL
> > -     || p_dec->fmt_out.video.i_width != p_owner->fmt.video.i_width
> > +    if( p_dec->fmt_out.video.i_width != p_owner->fmt.video.i_width
> >       || p_dec->fmt_out.video.i_height != p_owner-
> >       || >fmt.video.i_height
> >       || p_dec->fmt_out.video.i_visible_width != p_owner-
> >       || >fmt.video.i_visible_width
> >       || p_dec->fmt_out.video.i_visible_height != p_owner-
> >       || >fmt.video.i_visible_height
> > @@ -492,6 +491,8 @@ static int vout_update_format( decoder_t
> > *p_dec )
> >              return -1;
> >          }
> >      }
> > +    else if( p_owner->p_vout == NULL )
> > +        return -1;
> >      return 0;
> > }
> >
> > --
> > 2.9.3
> >
> > _______________________________________________
> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160926/a64272e6/attachment.html>


More information about the vlc-devel mailing list