[FFmpeg-devel] [PATCH] apngdec: use side data to pass extradata to the decoder
Andreas Cadhalpun
andreas.cadhalpun at googlemail.com
Tue Nov 1 20:05:54 EET 2016
On 01.11.2016 18:26, James Almer wrote:
> On 11/1/2016 1:18 PM, Andreas Cadhalpun wrote:
>> Fixes remuxing apng streams coming from the apng demuxer.
>> This is a regression since 940b8908b94404a65f9f55e33efb4ccc6c81383c.
>>
>> Found-by: James Almer <jamrial at gmail.com>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>> libavcodec/pngdec.c | 23 ++++++++++++++--
>> libavformat/apngdec.c | 73 +++++++++++++++++++++++++++++++++++----------------
>> 2 files changed, 71 insertions(+), 25 deletions(-)
>>
>> diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
>> index 36275ae..83eeb8d 100644
>> @@ -393,6 +409,7 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
>> pkt->pts = ctx->pkt_pts;
>> pkt->duration = ctx->pkt_duration;
>> ctx->pkt_pts += ctx->pkt_duration;
>> + ret = send_extradata(ctx, pkt);
>> return ret;
>> case MKTAG('I', 'E', 'N', 'D'):
>> ctx->cur_loop++;
>> @@ -400,9 +417,10 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
>> avio_seek(pb, -8, SEEK_CUR);
>> return AVERROR_EOF;
>> }
>> - if ((ret = avio_seek(pb, s->streams[0]->codecpar->extradata_size + 8, SEEK_SET)) < 0)
>> + if ((ret = avio_seek(pb, ctx->extra_data_size + 8, SEEK_SET)) < 0)
>> return ret;
>> - return 0;
>> + ret = send_extradata(ctx, pkt);
>> + return ret;
>
> return send_extradata(ctx, pkt);
Changed.
> Seems to work, so LGTM.
Pushed.
Best regards,
Andreas
More information about the ffmpeg-devel
mailing list