From be13e56c3c7f63f419177409b8ce1d4ea54c14c2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 4 Apr 2016 21:58:16 -0400 Subject: [PATCH] add some comments --- src/zm_remote_camera_rtsp.cpp | 1 + src/zm_rtp_source.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index 1d0968ee8..a86015d30 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -486,6 +486,7 @@ int RemoteCameraRtsp::CaptureAndRecord( Image &image, bool recording, char* even } #if HAVE_LIBSWSCALE +// Why are we re-scaling after writing out the packet? if(mConvertContext == NULL) { mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); diff --git a/src/zm_rtp_source.cpp b/src/zm_rtp_source.cpp index a61bfffe3..3923517f2 100644 --- a/src/zm_rtp_source.cpp +++ b/src/zm_rtp_source.cpp @@ -325,6 +325,9 @@ bool RtpSource::handlePacket( const unsigned char *packet, size_t packetLen ) mFrameReady.updateValueSignal( true ); if ( !mFrameProcessed.getValueImmediate() ) { + // What is the point of this for loop? Is it just me, or will it call getUpdatedValue once or twice? Could it not be better written as + // if ( ! mFrameProcessed.getUpdatedValue( 1 ) && mFrameProcessed.getUpdatedValue( 1 ) ) return false; + for ( int count = 0; !mFrameProcessed.getUpdatedValue( 1 ); count++ ) if( count > 1 ) return( false );