mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-31 12:13:04 -04:00
When dts==last_dts, don't log it as an error. It is too common. Just add duration and move on.
This commit is contained in:
@@ -1384,12 +1384,20 @@ int VideoStore::write_packet(AVPacket *pkt, AVStream *stream) {
|
||||
}
|
||||
pkt->dts = last_dts[stream->index];
|
||||
} else {
|
||||
if ((last_dts[stream->index] != AV_NOPTS_VALUE) and (pkt->dts <= last_dts[stream->index])) {
|
||||
Warning("non increasing dts, fixing. our dts %" PRId64 " stream %d last_dts %" PRId64 ". reorder_queue_size=%zu",
|
||||
pkt->dts, stream->index, last_dts[stream->index], reorder_queue_size);
|
||||
// dts MUST monotonically increase, so add 1 which should be a small enough time difference to not matter.
|
||||
pkt->dts = last_dts[stream->index]+last_duration[stream->index];
|
||||
if (pkt->dts > pkt->pts) pkt->pts = pkt->dts; // Do it here to avoid warning below
|
||||
if (last_dts[stream->index] != AV_NOPTS_VALUE) {
|
||||
if (pkt->dts < last_dts[stream->index]) {
|
||||
Warning("non increasing dts, fixing. our dts %" PRId64 " stream %d last_dts %" PRId64 ". reorder_queue_size=%zu",
|
||||
pkt->dts, stream->index, last_dts[stream->index], reorder_queue_size);
|
||||
pkt->dts = last_dts[stream->index]+last_duration[stream->index];
|
||||
if (pkt->dts > pkt->pts) pkt->pts = pkt->dts; // Do it here to avoid warning below
|
||||
} else if (pkt->dts == last_dts[stream->index]) {
|
||||
// Commonly seen
|
||||
Debug(1, "non increasing dts, fixing. our dts %" PRId64 " stream %d last_dts %" PRId64 ". reorder_queue_size=%zu",
|
||||
pkt->dts, stream->index, last_dts[stream->index], reorder_queue_size);
|
||||
// dts MUST monotonically increase, so add 1 which should be a small enough time difference to not matter.
|
||||
pkt->dts = last_dts[stream->index]+last_duration[stream->index];
|
||||
if (pkt->dts > pkt->pts) pkt->pts = pkt->dts; // Do it here to avoid warning below
|
||||
}
|
||||
}
|
||||
next_dts[stream->index] = pkt->dts + pkt->duration;
|
||||
last_dts[stream->index] = pkt->dts;
|
||||
|
||||
Reference in New Issue
Block a user