From d4645cd94a06ffbd4f13e14cbb55086c30db49e4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 16 Sep 2016 11:03:16 -0400 Subject: [PATCH] we should be queueing packets regardless of recording state --- src/zm_ffmpeg_camera.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 6a0ed04c9..bc3a666a2 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -650,19 +650,20 @@ Debug(5, "After av_read_frame (%d)", ret ); return 0; } } else { + // Not recording if ( videoStore ) { Info("Deleting videoStore instance"); delete videoStore; videoStore = NULL; } - - //Buffer video packets - if ( packet->flags & AV_PKT_FLAG_KEY ) { - packetqueue.clearQueue(); - } - packetqueue.queuePacket(packet); } // end if + //Buffer video packets + if ( packet->flags & AV_PKT_FLAG_KEY ) { + packetqueue.clearQueue(); + } + packetqueue.queuePacket(packet); + if ( packet->stream_index == mVideoStreamId ) { ret = zm_avcodec_decode_video( mVideoCodecContext, mRawFrame, &frameComplete, packet ); if ( ret < 0 ) {