remove test for negative pts. Negative pts is ok. Have been running this in master for a while with no negative effects.

This commit is contained in:
Isaac Connor 2021-01-22 12:07:47 -05:00
parent 7183a47a3a
commit 01ec57f902
1 changed files with 0 additions and 19 deletions

View File

@ -764,25 +764,6 @@ int FfmpegCamera::CaptureAndRecord(
return -1; return -1;
} }
if ( (packet.pts != AV_NOPTS_VALUE) && (packet.pts < -100000) ) {
// Ignore packets that have crazy negative pts.
// They aren't supposed to happen.
Warning("Ignore packet because pts %" PRId64 " is massively negative."
" Error count is %d", packet.pts, error_count);
dumpPacket(
mFormatContext->streams[packet.stream_index],
&packet,
"Ignored packet");
if ( error_count > 100 ) {
Error("Bad packet count over 100, going to close and re-open stream");
return -1;
}
error_count += 1;
continue;
}
// If we get a good frame, decrease the error count.. We could zero it...
if ( error_count > 0 ) error_count -= 1;
int keyframe = packet.flags & AV_PKT_FLAG_KEY; int keyframe = packet.flags & AV_PKT_FLAG_KEY;
bytes += packet.size; bytes += packet.size;
dumpPacket( dumpPacket(