File tree Expand file tree Collapse file tree 6 files changed +18
-9
lines changed
Examples/CrossPlatformTest Expand file tree Collapse file tree 6 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 2323 </Content >
2424 <Content Include =" openh264-2.4.1-win64.dll" >
2525 <PackagePath >\lib\$(TargetFramework)</PackagePath >
26- <CopyToOutputDirectory >Always </CopyToOutputDirectory >
26+ <CopyToOutputDirectory >Never </CopyToOutputDirectory >
2727 <Pack >true</Pack >
2828 </Content >
2929 </ItemGroup >
Original file line number Diff line number Diff line change @@ -56,15 +56,15 @@ private void LoadDecoder(string ciscoDllPath)
5656 // Success
5757 break ;
5858 case 1 :
59- throw new DllNotFoundException ( $ "Failed to load the decoder library: { ciscoDllPath } ") ;
59+ throw new DllNotFoundException ( $ "Failed to load the cisco library: { ciscoDllPath } ") ;
6060 case 2 :
6161 throw new EntryPointNotFoundException ( "Failed to load WelsCreateDecoder function" ) ;
6262 case 3 :
6363 throw new EntryPointNotFoundException ( "Failed to load WelsDestroyDecoder function" ) ;
6464 case 4 :
6565 throw new InvalidOperationException ( "Failed to create decoder instance" ) ;
6666 default :
67- throw new Exception ( $ "Unknown error occurred while loading decoder : { result } ") ;
67+ throw new Exception ( $ "Unknown error occurred code : { result } ") ;
6868 }
6969 }
7070
Original file line number Diff line number Diff line change @@ -51,15 +51,15 @@ private void LoadEncoder(string ciscoDllPath)
5151 // Success
5252 break ;
5353 case 1 :
54- throw new DllNotFoundException ( $ "Failed to load the encoder library: { ciscoDllPath } ") ;
54+ throw new DllNotFoundException ( $ "Failed to load the cisco library: { ciscoDllPath } ") ;
5555 case 2 :
5656 throw new EntryPointNotFoundException ( "Failed to load WelsCreateSVCEncoder function" ) ;
5757 case 3 :
5858 throw new EntryPointNotFoundException ( "Failed to load WelsDestroySVCEncoder function" ) ;
5959 case 4 :
6060 throw new InvalidOperationException ( "Failed to create encoder instance" ) ;
6161 default :
62- throw new Exception ( $ "Unknown error occurred while loading encoder : { result } ") ;
62+ throw new Exception ( $ "Unknown error occurred code : { result } ") ;
6363 }
6464 }
6565
Original file line number Diff line number Diff line change @@ -339,8 +339,13 @@ namespace H264Sharp {
339339 Decoder::~Decoder ()
340340 {
341341 FreeAllignAlloc (innerBuffer);
342- decoder->Uninitialize ();
343- DestroyDecoderFunc (decoder);
342+
343+ if (decoder !=nullptr )
344+ {
345+ decoder->Uninitialize ();
346+ DestroyDecoderFunc (decoder);
347+ }
348+
344349
345350 if (libraryHandle != nullptr ) {
346351#ifdef _WIN32
Original file line number Diff line number Diff line change @@ -693,8 +693,12 @@ namespace H264Sharp {
693693
694694 Encoder::~Encoder ()
695695 {
696- encoder->Uninitialize ();
697- DestroyEncoderFunc (encoder);
696+ if (encoder != nullptr )
697+ {
698+ encoder->Uninitialize ();
699+ DestroyEncoderFunc (encoder);
700+ }
701+
698702
699703 FreeAllignAlloc (innerBuffer);
700704 for (auto & it : efm)
You can’t perform that action at this time.
0 commit comments