Skip to content

Commit

Permalink
fix(concat): either add 1 or duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed May 16, 2024
1 parent 4f56640 commit 38648af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions video/concat/concat.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ void fix_ts(int64_t *dts_offset, int64_t **prev_dts, int64_t **prev_duration,
if (prev_dts[input_idx][pkt->stream_index] != AV_NOPTS_VALUE &&
prev_dts[input_idx][pkt->stream_index] >= pkt->dts + delta) {
// Offset because of non monotonic packet
delta = prev_dts[input_idx][pkt->stream_index] - pkt->dts +
prev_duration[input_idx][pkt->stream_index];
delta = prev_dts[input_idx][pkt->stream_index] - pkt->dts;
delta += prev_duration[input_idx][pkt->stream_index] > 0
? prev_duration[input_idx][pkt->stream_index]
: 1;

fprintf(stderr,
"input#%zu, stream #%d discontinuity, last.dts=%" PRId64 ", "
Expand Down

0 comments on commit 38648af

Please sign in to comment.