From 85202a0bfdb291687416413385345091fb10ae31 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Aug 2017 13:06:59 -0400 Subject: [PATCH 1/4] add test for when an event is deleted during audit --- scripts/zmaudit.pl.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index db8ca5933..2d6e97297 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -351,6 +351,10 @@ MAIN: while( $loop ) { if ( ! defined( $fs_events->{$db_event} ) ) { Debug("Event $db_event is not in fs."); my $Event = new ZoneMinder::Event( $db_event ); + if ( ! $Event->Id() ) { + Debug("Event $db_event is no longer in db. Filter probably deleted it while we were auditing."); + next; + } if ( ! $Event->StartTime() ) { Debug("Event $$Event{Id} has no start time. deleting it."); if ( confirm() ) { From 38111e80a5048284ef5037908ae7c39477648c8b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Aug 2017 13:17:51 -0400 Subject: [PATCH 2/4] use AVERROR_EOF instead of EOF --- src/zm_videostore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index c51740028..cafd6ddb2 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -333,7 +333,7 @@ VideoStore::~VideoStore(){ } ret = avcodec_receive_packet( audio_output_context, &pkt ); if ( ret < 0 ) { - if ( EOF != ret ) { + if ( AVERROR_EOF != ret ) { Error("ERror encoding audio while flushing (%d) (%s)", ret, av_err2str( ret )); } break; From 591fdfe68c9a3adb71ccc265945d6e6750257b7a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Aug 2017 13:44:23 -0400 Subject: [PATCH 3/4] fix --- src/zm_ffmpeg_camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index d8826f998..3ce3eeaed 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -292,7 +292,7 @@ int FfmpegCamera::OpenFfmpeg() { } else if ( method == "rtpRtspHttp" ) { ret = av_dict_set(&opts, "rtsp_transport", "http", 0); } else { - Warning("Unknown method (%s)", method); + Warning("Unknown method (%s)", method.c_str() ); } if ( ret < 0 ) { From e24a2935d20d63c39587c8ffa45ba28251f66ca5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Aug 2017 13:49:11 -0400 Subject: [PATCH 4/4] remove unneeded error message --- src/zm_videostore.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index cafd6ddb2..852c3fbf6 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -326,11 +326,7 @@ VideoStore::~VideoStore(){ while ( 1 ) { #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) // Put encoder into flushing mode - ret = avcodec_send_frame( audio_output_context, NULL ); - if ( ret < 0 ) { - Error("Error sending flush to encoder (%d) (%s)", ret, av_err2str( ret )); - break; - } + avcodec_send_frame( audio_output_context, NULL ); ret = avcodec_receive_packet( audio_output_context, &pkt ); if ( ret < 0 ) { if ( AVERROR_EOF != ret ) { @@ -869,12 +865,12 @@ int VideoStore::writeAudioFramePacket( AVPacket *ipkt ) { //av_frame_unref( output_frame ); if ( ( ret = avcodec_receive_packet( audio_output_context, &opkt ) ) < 0 ) { - if ( EAGAIN == ret ) { + if ( AVERROR(EAGAIN) == ret ) { // THe codec may need more samples than it has, perfectly valid Debug( 3, "Could not recieve packet (error '%s')", av_make_error_string(ret).c_str()); } else { - Error( "Could not recieve packet (error '%s')", + Error( "Could not recieve packet (error %d = '%s')", ret, av_make_error_string(ret).c_str()); } zm_av_packet_unref(&opkt);