Преглед изворни кода

Limit queue size to 10 frames

Workaround for ZLA, which seems to decode and queue twice as many frames as it displays.
ameerj пре 5 година
родитељ
комит
979b602738
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      src/video_core/command_classes/codecs/codec.cpp

+ 4 - 0
src/video_core/command_classes/codecs/codec.cpp

@@ -104,6 +104,10 @@ void Codec::Decode() {
         AVFramePtr frame = AVFramePtr{av_frame_alloc(), AVFrameDeleter};
         avcodec_receive_frame(av_codec_ctx, frame.get());
         av_frames.push(std::move(frame));
+        // Limit queue to 10 frames. Workaround for ZLA decode and queue spam
+        if (av_frames.size() > 10) {
+            av_frames.pop();
+        }
     }
 }