On 10/27/2016 4:19 PM, Andreas Cadhalpun wrote: > This fixes creating apng files. > > This partly reverts commit 5ef19590802f000299e418143fc2301e3f43affe. > > Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> > --- > ffmpeg.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/ffmpeg.c b/ffmpeg.c > index 3b91710..9971148 100644 > --- a/ffmpeg.c > +++ b/ffmpeg.c > @@ -646,6 +646,7 @@ static void write_packet(OutputFile *of, AVPacket *pkt, > OutputStream *ost) > { > AVFormatContext *s = of->ctx; > AVStream *st = ost->st; > + AVCodecContext *avctx = ost->encoding_needed ? ost->enc_ctx : > ost->st->codec;
No, AVStream->codec usage was removed. It can't be re added. > int ret; > > if (!of->header_written) { > @@ -709,6 +710,16 @@ static void write_packet(OutputFile *of, AVPacket *pkt, > OutputStream *ost) > } > } > > + if (!st->codecpar->extradata_size && avctx->extradata_size) { > + st->codecpar->extradata = av_mallocz(avctx->extradata_size + > AV_INPUT_BUFFER_PADDING_SIZE); > + if (!st->codecpar->extradata) { > + av_log(NULL, AV_LOG_ERROR, "Could not allocate extradata buffer > to copy parser data.\n"); > + exit_program(1); > + } > + st->codecpar->extradata_size = avctx->extradata_size; > + memcpy(st->codecpar->extradata, avctx->extradata, > avctx->extradata_size); > + } If apng encoder needs to add new extradata in a packet, it should do it with av_packet_new_side_data() instead. > + > if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) { > if (pkt->dts != AV_NOPTS_VALUE && > pkt->pts != AV_NOPTS_VALUE && > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel