Offset output dts by -1 when num_out >= gop_len, otherwise there will be a gap of 2 dts. Fixes #310

This commit is contained in:
Marko Viitanen 2021-10-11 11:18:58 +03:00
parent 54dc87dac9
commit 7918628b8e

View file

@ -183,7 +183,7 @@ kvz_picture* kvz_encoder_feed_frame(input_frame_buffer_t *buf,
dts_out = buf->pts_buffer[dts_idx % gop_buf_size] + buf->delay; dts_out = buf->pts_buffer[dts_idx % gop_buf_size] + buf->delay;
} else { } else {
int dts_idx = buf->num_out - (cfg->gop_len - 1); int dts_idx = buf->num_out - (cfg->gop_len - 1);
dts_out = buf->pts_buffer[dts_idx % gop_buf_size]; dts_out = buf->pts_buffer[dts_idx % gop_buf_size] - 1;
} }
} }
else { else {