Skip to content

Fix garbage DTS values on short encode sessions - #936

Merged
kirithika7 merged 1 commit into
Multicorewareinc:masterfrom
Akilan-Sivakumar:fix/uninitialized-dts-encoder
Aug 7, 2026
Merged

Fix garbage DTS values on short encode sessions#936
kirithika7 merged 1 commit into
Multicorewareinc:masterfrom
Akilan-Sivakumar:fix/uninitialized-dts-encoder

Conversation

@Akilan-Sivakumar

@Akilan-Sivakumar Akilan-Sivakumar commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator
  • Encoder::Encoder() never initializes m_firstPts, m_bframeDelayTime, or m_prevReorderedPts[].
  • If a stream is flushed before enough frames arrive to set m_bframeDelayTime legitimately, it retains whatever garbage was left on the heap (often leaked from a prior encoder session in long-running processes like ffmpeg), producing nonsensical DTS values.
  • Fix: initialize all three fields to 0 in the constructor, so the fallback DTS calculation (reorderedPts - 0) is correct when no real B-frame reordering has occurred yet.
  • Fixes Garbage DTS for short sequences #781

@Akilan-Sivakumar
Akilan-Sivakumar force-pushed the fix/uninitialized-dts-encoder branch from 8b48440 to a716426 Compare August 4, 2026 07:39
@kirithika7
kirithika7 merged commit fbd4338 into Multicorewareinc:master Aug 7, 2026
29 checks passed
@Akilan-Sivakumar
Akilan-Sivakumar deleted the fix/uninitialized-dts-encoder branch August 12, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Garbage DTS for short sequences

2 participants