File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -565,6 +565,12 @@ public DecoderConfig Clone()
565565 public bool ShowCorrupted { get => _ShowCorrupted ; set => SetUI ( ref _ShowCorrupted , value ) ; }
566566 bool _ShowCorrupted ;
567567
568+ /// <summary>
569+ /// Ensures that after a key packet receives a also key frame (can create artifacts on some broken formats when disabled)
570+ /// </summary>
571+ public bool KeyFrameValidation { get => _KeyFrameValidation ; set => SetUI ( ref _KeyFrameValidation , value ) ; }
572+ internal bool _KeyFrameValidation ;
573+
568574 /// <summary>
569575 /// Forces low delay (Parses AV_CODEC_FLAG2_FAST or AV_CODEC_FLAG_LOW_DELAY -based on DropFrames- to AVCodecContext) (auto-enabled with MaxLatency)
570576 /// </summary>
Original file line number Diff line number Diff line change @@ -531,7 +531,7 @@ public long GetVideoFrame(long timestamp = -1)
531531 if ( packet ->flags . HasFlag ( PktFlags . Key ) || packet ->pts == VideoDecoder . startPts )
532532 {
533533 VideoDecoder . keyPacketRequired = false ;
534- VideoDecoder . keyFrameRequired = true ;
534+ VideoDecoder . keyFrameRequired = Config . Decoder . _KeyFrameValidation ;
535535 }
536536 else
537537 {
Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ protected override void RunInternal()
493493 {
494494 if ( packet ->flags . HasFlag ( PktFlags . Key ) || packet ->pts == startPts )
495495 {
496- keyFrameRequired = true ;
496+ keyFrameRequired = Config . Decoder . _KeyFrameValidation ;
497497 keyPacketRequired = false ;
498498 }
499499 else
@@ -1086,7 +1086,7 @@ public int DecodeFrameNext()
10861086 if ( demuxer . packet ->flags . HasFlag ( PktFlags . Key ) || demuxer . packet ->pts == startPts )
10871087 {
10881088 keyPacketRequired = false ;
1089- keyFrameRequired = true ;
1089+ keyFrameRequired = Config . Decoder . _KeyFrameValidation ;
10901090 }
10911091 else
10921092 {
You can’t perform that action at this time.
0 commit comments