Skip to content

Comments

Fix sparse-VFR stall and stabilize missing-frame image fallback#1034

Merged
jonoomph merged 1 commit intodevelopfrom
sparse-vfr-support
Feb 10, 2026
Merged

Fix sparse-VFR stall and stabilize missing-frame image fallback#1034
jonoomph merged 1 commit intodevelopfrom
sparse-vfr-support

Conversation

@jonoomph
Copy link
Member

@jonoomph jonoomph commented Feb 8, 2026

FFmpegReader: fix sparse-VFR stall and stabilize missing-frame image fallback

  • prevent ReadStream() infinite loop when packet counters stall at EOF with no packet/hold state by detecting no-progress and forcing EOF completion
  • improve missing-frame handling on sparse timelines by preferring chronological image sources:
    • previous finalized frame (f->number - 1)
    • last finalized video frame (last_final_video_frame) - last decoded video frame only if not from the future - black frame only as last resort
  • use the same finalized/decoded fallback when largest_frame_processed is no longer cached
  • track/reset last_final_video_frame across finalize/seek/close lifecycle

Fixes:

  • hard stall around gap frames
  • black flashing from cache churn on sparse streams
  • out-of-order jitter caused by reusing future-decoded frames

…fallback

  - prevent ReadStream() infinite loop when packet counters stall at EOF with no packet/hold state by detecting no-progress and forcing EOF completion
  - improve missing-frame handling on sparse timelines by preferring chronological image sources:
      - previous finalized frame (f->number - 1)
      - last finalized video frame (last_final_video_frame)
      - last decoded video frame only if not from the future
      - black frame only as last resort
  - use the same finalized/decoded fallback when largest_frame_processed is no longer cached
  - track/reset last_final_video_frame across finalize/seek/close lifecycle

  Fixes:

  - hard stall around gap frames
  - black flashing from cache churn on sparse streams
  - out-of-order jitter caused by reusing future-decoded frames
@jonoomph
Copy link
Member Author

jonoomph commented Feb 8, 2026

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 63.15789% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.63%. Comparing base (47b3081) to head (01e6046).

Files with missing lines Patch % Lines
src/FFmpegReader.cpp 63.15% 21 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1034      +/-   ##
===========================================
+ Coverage    59.60%   59.63%   +0.03%     
===========================================
  Files          206      206              
  Lines        20374    20421      +47     
===========================================
+ Hits         12143    12179      +36     
- Misses        8231     8242      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonoomph jonoomph merged commit 57c1fb2 into develop Feb 10, 2026
13 checks passed
@jonoomph jonoomph deleted the sparse-vfr-support branch February 10, 2026 18:02
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.

1 participant