You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-09-16 08:36:51 +02:00
avformat/apngdec: set pts to AV_NOPTS_VALUE
And let the generic code figure out the proper PTS. This is needed because apng does not provide seek functions, but after a generic seek (e.g. to file start) timestamps are not reset which causes broken timestamps when looping apngs, like in ticket #6121. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -44,7 +44,6 @@ typedef struct APNGDemuxContext {
|
|||||||
int max_fps;
|
int max_fps;
|
||||||
int default_fps;
|
int default_fps;
|
||||||
|
|
||||||
int64_t pkt_pts;
|
|
||||||
int pkt_duration;
|
int pkt_duration;
|
||||||
|
|
||||||
int is_key_frame;
|
int is_key_frame;
|
||||||
@@ -390,9 +389,8 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
if (ctx->is_key_frame)
|
if (ctx->is_key_frame)
|
||||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||||
pkt->pts = ctx->pkt_pts;
|
pkt->pts = pkt->dts = AV_NOPTS_VALUE;
|
||||||
pkt->duration = ctx->pkt_duration;
|
pkt->duration = ctx->pkt_duration;
|
||||||
ctx->pkt_pts += ctx->pkt_duration;
|
|
||||||
return ret;
|
return ret;
|
||||||
case MKTAG('I', 'E', 'N', 'D'):
|
case MKTAG('I', 'E', 'N', 'D'):
|
||||||
ctx->cur_loop++;
|
ctx->cur_loop++;
|
||||||
|
Reference in New Issue
Block a user