Commit cacec38e authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #2380 from cudawarped:patch_cudacodec_memory_leak

parents 83ad5c63 7cb627a3
...@@ -62,7 +62,7 @@ cv::cudacodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname) ...@@ -62,7 +62,7 @@ cv::cudacodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname)
// now create the actual source // now create the actual source
CUresult cuRes = cuvidCreateVideoSource(&videoSource_, fname.c_str(), &params); CUresult cuRes = cuvidCreateVideoSource(&videoSource_, fname.c_str(), &params);
if (cuRes == CUDA_ERROR_INVALID_SOURCE) if (cuRes == CUDA_ERROR_INVALID_SOURCE)
throw std::runtime_error(""); CV_Error(Error::StsUnsupportedFormat, "Unsupported video source");
cuSafeCall( cuRes ); cuSafeCall( cuRes );
CUVIDEOFORMAT vidfmt; CUVIDEOFORMAT vidfmt;
......
...@@ -118,6 +118,7 @@ int CUDAAPI cv::cudacodec::detail::VideoParser::HandleVideoSequence(void* userDa ...@@ -118,6 +118,7 @@ int CUDAAPI cv::cudacodec::detail::VideoParser::HandleVideoSequence(void* userDa
try try
{ {
thiz->videoDecoder_->release();
thiz->videoDecoder_->create(newFormat); thiz->videoDecoder_->create(newFormat);
} }
catch (const cv::Exception&) catch (const cv::Exception&)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment