504 Commits

Author SHA1 Message Date
Jonathan Thomas
1a44a6582c Fixing mac unit test failures due to filesystem dependency again,ughh. 2026-02-24 13:05:39 -06:00
Jonathan Thomas
89350a0419 Setting has_static_image correctly when FFmpegReader opens image formats and a video_length == 1, so we have consistent behavior in OpenShot regardless of QtImageReader or FFmpegReader, when opening images. 2026-02-24 12:06:42 -06:00
Jonathan Thomas
18b08fe7c6 Fixing unit test paths for mac builders, crashing due to filesystem import (I think) 2026-02-23 17:41:18 -06:00
Jonathan Thomas
7c65748187 Fixing unit test paths for windows builders 2026-02-23 17:25:23 -06:00
Jonathan Thomas
7efc48006a Modify all throw InvalidFile(...) callsites: each now has a distinct message string, and adding unit tests to verify this.
So a crash line will now be more like:
  what(): FFmpegReader could not open media file. for file C:\...\TitleFileName%04d.png
  instead of only File could not be opened.
2026-02-23 16:55:49 -06:00
Jonathan Thomas
b7c37b84e4 - Fix FFmpegReader first-frame black regression by anchoring PTS offset to video start (and correcting video offset to use packet PTS), so AAC preroll/skip-samples no longer shifts frame 1.
- Add examples/test_aac_preroll.mp4 fixture (small, deterministic AAC-preroll sample) for reproducing and testing the regression.
2026-02-15 15:22:11 -06:00
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
16f791a55a Adding missing <sstream> includes for older compilers, and because it should be included anyway 2025-12-16 18:23:57 -06:00
Jonathan Thomas
2a82bed607 Adding upscaling for crop effect + resize property - so cropping into higher resolution content does not become blurry. 2025-12-15 23:34:48 -06:00
Jonathan Thomas
bd59e6bb37 Fix mixing licensing headers 2025-12-15 21:13:34 -06:00
Jonathan Thomas
1f06f03e9c Adding unit tests for image magic durations 2025-12-10 18:38:07 -06:00
Jonathan Thomas
94fab00048 Updating video_length and duration calculations to be consistent on image readers also (QtImageReader, ImageReader) 2025-12-08 18:33:23 -06:00
Jonathan Thomas
eea55982fd FFmpegReader: add duration strategy modes and unify duration/frame calculations. This is a potentially breaking change, where we ensure all durations and video_length calculations coming from FFmpegReader are now fully consistent - even if we must slightly adjust a duration from the video or audio stream. This keeps the 2 attributes identical in meaning (video_length X FPS == duration, no exceptions). Unknown durations are no longer -1 video_length but 0, and 0 duration. 2025-12-08 17:07:21 -06:00
Jonathan Thomas
af9a4893ed Fixing regression inside AudioWaveformer so it uses a proper detached reader, and no longer mutates the Clip's reader (preventing a bug which caused our video to disappear when waveforms were used on the clip) 2025-11-24 18:33:25 -06:00
Jonathan Thomas
d4647b5525 Refactoring the AudioWaveformer again, this time to de-couple it from the actual clip object passed to it, and to no longer iterate over the potential longer time keyframes using GetFrame alone. Now, we only decode audio-streams, and only get the original samples (reduced sample rate drastically), and finally we apply keyframes (volume and time) to modify our original samples. This is a HUGE speed-up boost for waveform generation. 2025-11-23 14:11:53 -06:00
Jonathan Thomas
0dfc8a8a37 Updating 1D and 3D unit tests for Color Map to use a more obvious cube color map, with 1D = green and blue, and 3D = red and blue. 2025-11-18 18:11:37 -06:00
Jonathan Thomas
e25763d089 Adding awareness of DOMAIN_MIN and DOMAIN_MAX properties of LUT Color Map files and new unit tests to validate them 2025-11-18 17:36:30 -06:00
Jonathan Thomas
1c912d8fd6 Fixing clip unit tests due to regression in the initial rotation keyframe 2025-11-18 14:34:23 -06:00
Jonathan Thomas
2f82e7d27b Adding support for 1D and 3D LUT Color Map files. Also added new unit tests to verify 1D and 3D LUT files. 2025-11-18 14:26:59 -06:00
Jonathan Thomas
a7dfc596ca Fixing regression in Clip::init_reader_rotation() function, which could sometimes override scale_x and scale_y, when a rotation keyframe contained more than 1 point. 2025-11-13 16:18:18 -06:00
Jonathan Thomas
5596344575 Fixing AudioWaveformer::ExtractSamples to pause temporarily when a clip's reader is closed, and resume extracting when it's open again. This prevents a very common crash / bug when generating waveforms for longer audio clips and continuing to make chagnes on the timeline (which closes all clips temporarily - interrupting the waveform extracting). 2025-11-06 14:51:57 -06:00
Jonathan Thomas
0932af2c1e Fixing race condition on unit test for AnalogTape (when comparing frame's getting modified) 2025-10-11 16:45:43 -05:00