From 4d81b7b66bb49b1f3e9536dfbceb627bcacbd049 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 1 Mar 2018 19:21:41 -0800 Subject: [PATCH] Do not just reconnect to the input stream on EOF. pts/dts gets outof whack when doing passthrough. Instead treat it as a loss of signal, which will end the event and start a new one --- src/zm_ffmpeg_camera.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index c43bb3389..fae261e65 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -710,20 +710,6 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event ret = av_read_frame( mFormatContext, &packet ); if ( ret < 0 ) { av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); - if ( - // Check if EOF. - (ret == AVERROR_EOF || (mFormatContext->pb && mFormatContext->pb->eof_reached)) || - // Check for Connection failure. - (ret == -110) - ) { - Info( "av_read_frame returned \"%s\". Reopening stream.", errbuf); - if ( ReopenFfmpeg() < 0 ) { - // OpenFfmpeg will do enough logging. - return -1; - } - continue; - } - Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, errbuf ); return -1; }