[FFmpeg-devel] [PATCH 1/2] avcodec/mobiclip: add missing flush

Paul B Mahol onemda at gmail.com
Sun Sep 13 23:34:01 EEST 2020


On Sun, Sep 13, 2020 at 12:13:23PM -0300, James Almer wrote:
> On 9/10/2020 5:39 PM, Paul B Mahol wrote:
> > Signed-off-by: Paul B Mahol <onemda at gmail.com>
> > ---
> >  libavcodec/mobiclip.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
> > index d147eddbae..c296ce3c78 100644
> > --- a/libavcodec/mobiclip.c
> > +++ b/libavcodec/mobiclip.c
> > @@ -1389,6 +1389,14 @@ static int mobiclip_decode(AVCodecContext *avctx, void *data,
> >      return 0;
> >  }
> >  
> > +static void mobiclip_flush(AVCodecContext *avctx)
> > +{
> > +    MobiClipContext *s = avctx->priv_data;
> > +
> > +    for (int i = 0; i < 6; i++)
> > +        av_frame_unref(s->pic[i]);
> 
> Shouldn't you also zero s->current_pic? It's used as an index for this
> array.

Not really required as it is not important, it cycles/wraps around.

> 
> > +}
> > +
> >  static av_cold int mobiclip_close(AVCodecContext *avctx)
> >  {
> >      MobiClipContext *s = avctx->priv_data;
> > @@ -1421,6 +1429,7 @@ AVCodec ff_mobiclip_decoder = {
> >      .priv_data_size = sizeof(MobiClipContext),
> >      .init           = mobiclip_init,
> >      .decode         = mobiclip_decode,
> > +    .flush          = mobiclip_flush,
> >      .close          = mobiclip_close,
> >      .capabilities   = AV_CODEC_CAP_DR1,
> >  };
> > 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list