From 5ba13f1a762054342db060fb2befb932882835cc Mon Sep 17 00:00:00 2001 From: SteveGilvarry Date: Wed, 4 Nov 2015 16:24:39 +1100 Subject: [PATCH] ffmpeg 2.9 patched removed SSE2 CPU flags as these are automatically detected for all ffmpeg versions circa 2010. This commit removes the if statement on duplicated functions. --- src/zm_ffmpeg_camera.cpp | 7 ++----- src/zm_local_camera.cpp | 9 +++------ src/zm_remote_camera_rtsp.cpp | 7 ++----- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index ca1d52602..9e3a2960c 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -187,11 +187,8 @@ int FfmpegCamera::Capture( Image &image ) #if HAVE_LIBSWSCALE if(mConvertContext == NULL) { - if(config.cpu_extensions && sseversion >= 20) { - mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - } else { - mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - } + mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); + if(mConvertContext == NULL) Fatal( "Unable to create conversion context for %s", mPath.c_str() ); } diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index 261d4e5f9..022f35dbe 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -631,14 +631,11 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel, Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize); } - if(config.cpu_extensions && sseversion >= 20) { - imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - } else { - imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - } + imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - if ( !imgConversionContext ) + if ( !imgConversionContext ) { Fatal( "Unable to initialise image scaling context" ); + } } #endif diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index 05e68700a..7e00a5d60 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -333,11 +333,8 @@ int RemoteCameraRtsp::Capture( Image &image ) #if HAVE_LIBSWSCALE if(mConvertContext == NULL) { - if(config.cpu_extensions && sseversion >= 20) { - mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - } else { - mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); - } + mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); + if(mConvertContext == NULL) Fatal( "Unable to create conversion context"); }