Skip to content

Instantly share code, notes, and snippets.

@dwbuiten
Created March 23, 2018 20:36
Show Gist options
  • Save dwbuiten/a952866e4d89a64beabe64fdd929b5e7 to your computer and use it in GitHub Desktop.
Save dwbuiten/a952866e4d89a64beabe64fdd929b5e7 to your computer and use it in GitHub Desktop.
commit c870059ddb2131e6bf20c89b164aa69e5531c0e8
Author: Derek Buitenhuis <[email protected]>
Date: Fri Mar 23 20:34:21 2018 +0000
videosource: Do not increment the delay counter when packets are marked as DISCARD
They do not count towards the codec delay, and are used to signal, for example,
edit list edits.
Signed-off-by: Derek Buitenhuis <[email protected]>
diff --git a/src/core/videosource.cpp b/src/core/videosource.cpp
index eef6f5c..75797b0 100644
--- a/src/core/videosource.cpp
+++ b/src/core/videosource.cpp
@@ -534,7 +534,8 @@ bool FFMS_VideoSource::DecodePacket(AVPacket *Packet) {
int Ret = avcodec_receive_frame(CodecContext, DecodeFrame);
if (Ret != 0) {
std::swap(DecodeFrame, LastDecodedFrame);
- DelayCounter++;
+ if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
+ DelayCounter++;
}
if (Ret == 0 && InitialDecode == 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment