Manually set dts if it's the same as the last we output

In #1 we changed to manually set it if it is less than the last we
output. Apparently there are streams where it can be equal as well.

If we don't do this, then we see errors such as "Application provided
invalid, non monotonically increasing dts to muxer"
This commit is contained in:
Will Storey
2018-01-11 21:44:54 -08:00
parent 4392be9f01
commit 93d839ecef

View File

@@ -376,7 +376,7 @@ vs_write_packet(const struct VSInput * const input,
// 3.2.4 at least) there is logic to rewrite the dts and warn if it happens. // 3.2.4 at least) there is logic to rewrite the dts and warn if it happens.
// Let's do the same. Note my logic is a little different here. // Let's do the same. Note my logic is a little different here.
if (pkt->dts != AV_NOPTS_VALUE && output->last_dts != AV_NOPTS_VALUE && if (pkt->dts != AV_NOPTS_VALUE && output->last_dts != AV_NOPTS_VALUE &&
pkt->dts < output->last_dts) { pkt->dts <= output->last_dts) {
int64_t const next_dts = output->last_dts+1; int64_t const next_dts = output->last_dts+1;
if (verbose) { if (verbose) {