On Tue, 3 Dec 2013 07:59:30 +0100, Hendrik Leppkes <h.lepp...@gmail.com> wrote:
> On Tue, Dec 3, 2013 at 12:16 AM, Anton Khirnov <an...@khirnov.net> wrote:
> > This will allow removing the hacks where each decoder sets
> > current_picture_ptr on its own.
> > ---
> >  libavcodec/vc1dec.c |   24 ++++++++++++------------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> >
> > diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
> > index 4a73d2c..ab4e098 100644
> > --- a/libavcodec/vc1dec.c
> > +++ b/libavcodec/vc1dec.c
> > @@ -5943,18 +5943,6 @@ static int vc1_decode_frame(AVCodecContext *avctx, 
> > void *data,
> >          goto err;
> >      }
> >
> > -    // process pulldown flags
> > -    s->current_picture_ptr->f.repeat_pict = 0;
> > -    // Pulldown flags are only valid when 'broadcast' has been set.
> > -    // So ticks_per_frame will be 2
> > -    if (v->rff) {
> > -        // repeat field
> > -        s->current_picture_ptr->f.repeat_pict = 1;
> > -    } else if (v->rptfrm) {
> > -        // repeat frames
> > -        s->current_picture_ptr->f.repeat_pict = v->rptfrm * 2;
> > -    }
> > -
> >      // for skipping the frame
> >      s->current_picture.f.pict_type = s->pict_type;
> >      s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
> > @@ -5980,6 +5968,18 @@ static int vc1_decode_frame(AVCodecContext *avctx, 
> > void *data,
> >          goto err;
> >      }
> >
> > +    // process pulldown flags
> > +    s->current_picture_ptr->f.repeat_pict = 0;
> > +    // Pulldown flags are only valid when 'broadcast' has been set.
> > +    // So ticks_per_frame will be 2
> > +    if (v->rff) {
> > +        // repeat field
> > +        s->current_picture_ptr->f.repeat_pict = 1;
> > +    } else if (v->rptfrm) {
> > +        // repeat frames
> > +        s->current_picture_ptr->f.repeat_pict = v->rptfrm * 2;
> > +    }
> > +
> >      s->me.qpel_put = s->dsp.put_qpel_pixels_tab;
> >      s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab;
> >
> > --
> > 1.7.10.4
> 
> Why not simply change it to current_picture without _ptr like the
> lines immediately below the block you moved?
> 

Because it's the _ptr one that actually gets returned to the caller.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to