@@ -4439,8 +4439,9 @@ static int process_input(int file_index)
pkt_dts != AV_NOPTS_VALUE && ist->next_dts == AV_NOPTS_VALUE && !copy_ts
&& (is->iformat->flags & AVFMT_TS_DISCONT) && ifile->last_ts != AV_NOPTS_VALUE) {
int64_t delta = pkt_dts - ifile->last_ts;
- if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
- delta > 1LL*dts_delta_threshold*AV_TIME_BASE){
+ int64_t effective_threshold = !dts_delta_threshold ? 10*AV_TIME_BASE : dts_delta_threshold*AV_TIME_BASE;
+ if (delta < -1LL*effective_threshold ||
+ delta > 1LL*effective_threshold){
ifile->ts_offset -= delta;
av_log(NULL, AV_LOG_DEBUG,
"Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
@@ -4478,9 +4479,11 @@ static int process_input(int file_index)
!disable_discontinuity_correction) {
int64_t delta = pkt_dts - ist->next_dts;
if (is->iformat->flags & AVFMT_TS_DISCONT) {
- if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
- delta > 1LL*dts_delta_threshold*AV_TIME_BASE ||
- pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
+ int64_t effective_delta_threshold = !dts_delta_threshold ? 10*AV_TIME_BASE : dts_delta_threshold*AV_TIME_BASE;
+ int64_t effective_negative_threshold = !dts_delta_threshold ? AV_TIME_BASE/10 : dts_delta_threshold*AV_TIME_BASE;
+ if (delta < -1LL*effective_delta_threshold ||
+ delta > 1LL*effective_delta_threshold ||
+ pkt_dts + effective_negative_threshold < FFMAX(ist->pts, ist->dts)) {
ifile->ts_offset -= delta;
av_log(NULL, AV_LOG_DEBUG,
"timestamp discontinuity for stream #%d:%d "
@@ -146,7 +146,7 @@ char *vstats_filename;
char *sdp_filename;
float audio_drift_threshold = 0.1;
-float dts_delta_threshold = 10;
+float dts_delta_threshold = 0;
float dts_error_threshold = 3600*30;
int audio_volume = 256;