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 );