Skip to content
Snippets Groups Projects
Commit b2a8ce4e authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

nutenc: keep track of max_pts

parent c2a134c6
No related branches found
No related tags found
No related merge requests found
...@@ -103,6 +103,8 @@ typedef struct { ...@@ -103,6 +103,8 @@ typedef struct {
AVRational *time_base; AVRational *time_base;
struct AVTreeNode *syncpoints; struct AVTreeNode *syncpoints;
int sp_count; int sp_count;
int64_t max_pts;
AVRational *max_pts_tb;
} NUTContext; } NUTContext;
extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_subtitle_tags[];
......
...@@ -863,6 +863,11 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){ ...@@ -863,6 +863,11 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){
nus->keyframe_pts[nut->sp_count] = pkt->pts; nus->keyframe_pts[nut->sp_count] = pkt->pts;
} }
if(!nut->max_pts_tb || av_compare_ts(nut->max_pts, *nut->max_pts_tb, pkt->pts, *nus->time_base) < 0) {
nut->max_pts = pkt->pts;
nut->max_pts_tb = nus->time_base;
}
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment