On Tue, Nov 25, 2014 at 02:56:07PM -0300, James Almer wrote: > Should fix framedrops on some apng files > > Signed-off-by: James Almer <jamr...@gmail.com> > --- > This is still not optimal because the value of time_base will be updated on > every frame, > and in some cases delay_num and delay_den varies between frames. > > Better fix welcome. > > libavformat/apngdec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c > index d766a87..47d3753 100644 > --- a/libavformat/apngdec.c > +++ b/libavformat/apngdec.c > @@ -265,8 +265,8 @@ static int decode_fctl_chunk(AVFormatContext *s, > APNGDemuxContext *ctx, AVPacket > delay_num = 1; > delay_den = ctx->default_fps; > } > - s->streams[0]->r_frame_rate.num = delay_den; > - s->streams[0]->r_frame_rate.den = delay_num; > + s->streams[0]->time_base.num = delay_num; > + s->streams[0]->time_base.den = delay_den; > pkt->duration = 1;
this is wrong, the timebase and r_frame_rate are constant once they have been set i suggest to use set_pts_info to set a reasonable precisse timebase something like one millionth or billionth or similar in base 2. and then set pts based on these delays and the previous timestamp That is unless apng has proper timestamps, in which case they should be used [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel