Browse Source

nutenc: keep track of max_pts

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.0
Michael Niedermayer 13 years ago
parent
commit
b2a8ce4e67
2 changed files with 7 additions and 0 deletions
  1. +2
    -0
      libavformat/nut.h
  2. +5
    -0
      libavformat/nutenc.c

+ 2
- 0
libavformat/nut.h View File

@@ -103,6 +103,8 @@ typedef struct {
AVRational *time_base;
struct AVTreeNode *syncpoints;
int sp_count;
int64_t max_pts;
AVRational *max_pts_tb;
} NUTContext;

extern const AVCodecTag ff_nut_subtitle_tags[];


+ 5
- 0
libavformat/nutenc.c View File

@@ -863,6 +863,11 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){
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;
}



Loading…
Cancel
Save