Unified · Split
| @@ -3714,8 +3714,7 @@ static void ts_discontinuity_process(InputFile *ifile, InputStream *ist, · 3713 unmodified lines | ||
| 3714 | 3714 | if (ist->next_dts != AV_NOPTS_VALUE && !disable_discontinuity_correction) { |
| 3715 | 3715 | int64_t delta = pkt_dts - ist->next_dts; |
| 3716 | 3716 | if (fmt_is_discont) { |
| 3717 | − if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE || | |
| 3718 | − delta > 1LL*dts_delta_threshold*AV_TIME_BASE || | |
| 3717 | + if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE || | |
| 3719 | 3718 | pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) { |
| 3720 | 3719 | ifile->ts_offset -= delta; |
| 3721 | 3720 | av_log(NULL, AV_LOG_DEBUG, |
| @@ -3729,16 +3728,14 @@ static void ts_discontinuity_process(InputFile *ifile, InputStream *ist, · 7 unmodified lines | ||
| 3729 | 3728 | pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); |
| 3730 | 3729 | } |
| 3731 | 3730 | } else { |
| 3732 | − if (delta < -1LL*dts_error_threshold*AV_TIME_BASE || | |
| 3733 | − delta > 1LL*dts_error_threshold*AV_TIME_BASE) { | |
| 3731 | + if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) { | |
| 3734 | 3732 | av_log(NULL, AV_LOG_WARNING, "DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n", pkt->dts, ist->next_dts, pkt->stream_index); |
| 3735 | 3733 | pkt->dts = AV_NOPTS_VALUE; |
| 3736 | 3734 | } |
| 3737 | 3735 | if (pkt->pts != AV_NOPTS_VALUE){ |
| 3738 | 3736 | int64_t pkt_pts = av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); |
| 3739 | 3737 | delta = pkt_pts - ist->next_dts; |
| 3740 | − if (delta < -1LL*dts_error_threshold*AV_TIME_BASE || | |
| 3741 | − delta > 1LL*dts_error_threshold*AV_TIME_BASE) { | |
| 3738 | + if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) { | |
| 3742 | 3739 | av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt->pts, ist->next_dts, pkt->stream_index); |
| 3743 | 3740 | pkt->pts = AV_NOPTS_VALUE; |
| 3744 | 3741 | } |
| @@ -3747,8 +3744,7 @@ static void ts_discontinuity_process(InputFile *ifile, InputStream *ist, · 2 unmodified lines | ||
| 3747 | 3744 | } else if (ist->next_dts == AV_NOPTS_VALUE && !copy_ts && |
| 3748 | 3745 | fmt_is_discont && ifile->last_ts != AV_NOPTS_VALUE) { |
| 3749 | 3746 | int64_t delta = pkt_dts - ifile->last_ts; |
| 3750 | − if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE || | |
| 3751 | − delta > 1LL*dts_delta_threshold*AV_TIME_BASE) { | |
| 3747 | + if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE) { | |
| 3752 | 3748 | ifile->ts_offset -= delta; |
| 3753 | 3749 | av_log(NULL, AV_LOG_DEBUG, |
| 3754 | 3750 | "Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", |