Revision 023857be

View differences:

ffmpeg.c
243 243
static int limit_filesize = 0; //
244 244

  
245 245
static int pgmyuv_compatibility_hack=0;
246
static int dts_delta_threshold = 10;
246 247

  
247 248
const char **opt_names=NULL;
248 249
int opt_name_count=0;
......
2047 2048
//        fprintf(stderr, "next:%lld dts:%lld off:%lld %d\n", ist->next_pts, pkt.dts, input_files_ts_offset[ist->file_index], ist->st->codec->codec_type);
2048 2049
        if (pkt.dts != AV_NOPTS_VALUE && ist->next_pts != AV_NOPTS_VALUE) {
2049 2050
            int64_t delta= av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q) - ist->next_pts;
2050
            if(ABS(delta) > 10LL*AV_TIME_BASE && !copy_ts){
2051
            if(ABS(delta) > 1LL*dts_delta_threshold*AV_TIME_BASE && !copy_ts){
2051 2052
                input_files_ts_offset[ist->file_index]-= delta;
2052 2053
                if (verbose > 2)
2053 2054
                    fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", delta, input_files_ts_offset[ist->file_index]);
......
4026 4027
    { "vglobal", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_global_header}, "video global header storage type", "" },
4027 4028
    { "copyts", OPT_BOOL | OPT_EXPERT, {(void*)&copy_ts}, "copy timestamps" },
4028 4029
    { "shortest", OPT_BOOL | OPT_EXPERT, {(void*)&opt_shortest}, "finish encoding within shortest input" }, //
4030
    { "dts_delta_threshold", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&dts_delta_threshold}, "timestamp discontinuity delta threshold", "" },
4029 4031

  
4030 4032
    /* video options */
4031 4033
    { "b", HAS_ARG | OPT_VIDEO, {(void*)opt_video_bitrate}, "set video bitrate (in kbit/s)", "bitrate" },

Also available in: Unified diff