5 Commits

Author SHA1 Message Date
Jonathan Thomas
c43092eaa5 Merge branch 'develop' into caching-protections
# Conflicts:
#	src/Qt/VideoCacheThread.cpp
2026-02-13 11:29:32 -06:00
Jonathan Thomas
fb41a3c479 • - Fix VideoCacheThread::isReady() so preroll readiness is clamped by frames actually available to the timeline boundary (end/start), preventing playback from stalling in PLAY near the end.
- Add regression coverage in tests/VideoCacheThread.cpp (isReady: clamps preroll requirement at timeline boundaries) for forward-near-end and backward-near-start cases.
2026-02-12 23:41:51 -06:00
Jonathan Thomas
d70e80eac4 Harden playback/cache path for malformed media and concurrent timeline updates
- Invalidate timeline cache on ApplyJsonDiff() clip insert (remove affected frame range).
  - Add lock in Timeline::ClearAllCache() for safe concurrent access.
  - Make VideoCacheThread cross-thread state safe (atomics + seek-state mutex).
  - Lock CacheMemory::Contains() to avoid races.
  - Handle malformed audio streams in FFmpegReader by disabling invalid audio and continuing video-only.
  - Add FPS/timebase safety fallbacks in FFmpeg frame/PTS math.
  - Guard Frame::GetSamplesPerFrame() against invalid inputs.
  - Add/adjust regression tests for cache invalidation and invalid rate handling.
2026-02-11 20:11:47 -06:00
Jonathan Thomas
43f9ed89ae VideoCacheThread: add directional preroll
- start cache rebuilds with a preroll offset (settings-based)
- tighten isReady to require frames ahead/behind playhead add unit tests for preroll clamping and readiness
2026-02-05 12:39:06 -06:00
Jonathan Thomas
364fb37565 Unit tests for new VideoCacheThread, to test all helper methods and ensure our general logic is correct (caching forward and backwards) 2025-06-03 22:24:34 -05:00