[FFmpeg-devel] [PATCH V1 4/4] lavf/mux: remove unnecessary packet reset

mypopy at gmail.com mypopy at gmail.com
Wed Sep 11 05:22:39 EEST 2019


On Tue, Sep 10, 2019 at 8:05 PM Andreas Rheinhardt
<andreas.rheinhardt at gmail.com> wrote:
>
> Jun Zhao:
> > From: Jun Zhao <barryjzhao at tencent.com>
> >
> > remove unnecessary packet reset in av_interleaved_write_frame
> >
> > Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
> > ---
> >  libavformat/mux.c |    6 ++----
> >  1 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavformat/mux.c b/libavformat/mux.c
> > index 0227c0d..9bac252 100644
> > --- a/libavformat/mux.c
> > +++ b/libavformat/mux.c
> > @@ -1227,11 +1227,9 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
> >      for (;; ) {
> >          AVPacket opkt;
> >          int ret = interleave_packet(s, &opkt, pkt, flush);
> > -        if (pkt) {
> > -            memset(pkt, 0, sizeof(*pkt));
> > -            av_init_packet(pkt);
> > +        if (pkt)
> >              pkt = NULL;
> > -        }
> > +
> >          if (ret <= 0) //FIXME cleanup needed for ret<0 ?
> >              return ret;
> >
> I made a patchset [1] (that has already been partially pushed) whose
> patch 11 deals with the memleak that happens on error in the above
> code and also removes the unnecessary packet reset on success.
>
> - Andreas
>
> [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248140.html
> [2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248145.html
>
I didn't notice that pathset details, please goto the patchset, will
drop the patch, Thanks


More information about the ffmpeg-devel mailing list