From 01ec57f90254198a9bb2dcc762f654141ce78b54 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 22 Jan 2021 12:07:47 -0500 Subject: [PATCH] remove test for negative pts. Negative pts is ok. Have been running this in master for a while with no negative effects. --- src/zm_ffmpeg_camera.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 2ca712db8..5b6e92bcf 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -764,25 +764,6 @@ int FfmpegCamera::CaptureAndRecord( 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; bytes += packet.size; dumpPacket(