[FFmpeg-devel] [PATCH] ffmpeg; check return code of avcodec_send_frame when flushing encoders

Nicolas George george at nsup.org
Tue Apr 18 08:09:30 EEST 2017

Le nonidi 29 germinal, an CCXXV, Michael Niedermayer a écrit :
> > +                while ((ret = avcodec_receive_packet(enc, &pkt)) == AVERROR(EAGAIN)) {
> > +                    ret = avcodec_send_frame(enc, NULL);

The doc says:

# The functions will not return AVERROR(EAGAIN), unless you forgot to
# enter draining mode.

> can the code be changed to not require this ?

I would say the code does not require this as is.

An assert to verify the invariant provided by the doc would probably be
a good idea, though.


  Nicolas George

More information about the ffmpeg-devel mailing list