replace cur_dts mangling with use of our next_dts array

pull/3466/head
Isaac Connor 2022-04-06 09:59:13 -04:00
parent 1f5d7866f7
commit 1e6f34235c
1 changed files with 20 additions and 0 deletions

View File

@ -1227,6 +1227,26 @@ int VideoStore::write_packet(AVPacket *pkt, AVStream *stream) {
pkt->dts = stream->cur_dts;*/ pkt->dts = stream->cur_dts;*/
} }
if (pkt->dts > pkt->pts) {
Warning("pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")."
"Decompression must happen before presentation.",
pkt->dts, pkt->pts);
/* Debug(1,
"pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")."
"Decompression must happen before presentation.",
pkt->dts, pkt->pts);*/
pkt->pts = pkt->dts;
}
#else
if (pkt->dts == AV_NOPTS_VALUE) {
Error("undefined dts");
// Debug(1, "undef dts, fixing by setting to stream cur_dts %" PRId64, stream->cur_dts);
// pkt->dts = stream->cur_dts;
} else if (pkt->dts < next_dts[stream->index]) {
Debug(1, "non increasing dts, fixing. our dts %" PRId64 " stream next_dts %" PRId64, pkt->dts, next_dts[stream->index]);
pkt->dts = next_dts[stream->index];
}
if (pkt->dts > pkt->pts) { if (pkt->dts > pkt->pts) {
Warning("pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")." Warning("pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")."
"Decompression must happen before presentation.", "Decompression must happen before presentation.",