Jonathan Thomas
fbd0ecfc83
Merge branch 'develop' into caching-timing-improvements
2022-02-13 10:59:27 -06:00
Jonathan Thomas
d24e39407e
Prevent crashes:
...
- Tweaking GetSmallestFrame to not use an additional mutex.
- Replace 2 mutex on Timeline::GetFrame with 1 mutex.
- Remove mutex from Timeline::ClearAllCache.
- Slow down loop on video cache thread.
- Protect audioThread::Seek() if missing a source.
- Rearrange StopPlayback to always stop the videoCache thread first.
2022-02-12 13:31:21 -06:00
Jonathan Thomas
97ed0f92ab
Improved scrubbing to not wait on pre-roll
2022-02-11 15:27:23 -06:00
Jonathan Thomas
fd3865a8e6
Detecting default sample rate of default audio device (Windows seems to play audio out of sync on certain audio drivers, if there is a mismatch between OpenShot and the default system audio sample rate). This info will help debug issues. Adding back in a mutex on Timeline::GetFrame causing crashes.
2022-02-11 14:12:25 -06:00
Jonathan Thomas
ec64635a6c
Don't use any input channels when initializing audio device
2022-02-10 16:56:06 -06:00
Jonathan Thomas
2e9afdb13f
DEBUG output of default output sample rate
2022-02-10 16:13:24 -06:00
Jonathan Thomas
35d4629df6
Large refactor to caching and playback timing:
...
- Support different speeds (-1X, 2X, 4X, etc...)
- Clamp getFrame between 1 and timeline length
- Support rewind using new timing code
- Caching in both directions (based on previous speed)
- Removing mutex from Timeline::GetFrame (cached path)
- Caching supports actual speed now
- Bust cache and trigger pre-roll if we encounter too many uncached frames. This will re-sync the video + audio threads.
- Sleep less in cache loop / Adjusting min frames to 24 (trial and error). Too few and backwards playback suffers. Too many and all playback waits.
2022-02-09 17:29:04 -06:00
Jonathan Thomas
0035fc6498
Removing audio seek from PlayerPrivate.cpp pause code, since this causes crashes when terminating openshot-qt.
2022-02-02 18:43:28 -06:00
Jonathan Thomas
32347a4c60
Fixing memory issues with FrameMapper, Cache, and Keyframe objects (which use vectors that can hold tons of objects, and were not fully releasing the memory on the heap until the program terminates)
2022-02-02 18:32:47 -06:00
Jonathan Thomas
5fe398bda5
Reducing pre-roll to 12 frames
2022-02-01 15:46:35 -06:00
Jonathan Thomas
f70ca4b877
Break out of cache loop if playback speed changes during caching. Move getFrame() below pause code, to prevent accidental incrementing video_position.
2022-02-01 15:33:32 -06:00
Jonathan Thomas
87a6aa9b39
Improved pausing code on video playback, to allow for scrubbing during paused state.
2022-01-31 17:15:52 -06:00
Jonathan Thomas
ff455f0752
Moving from high resolution timer to system_clock, trying to avoid a Mac build error
2022-01-31 15:28:46 -06:00
Jonathan Thomas
176f2fff9c
Big refactor of AudioReaderSource, to be simpler, and only fill the audio samples requested (removed double/internal buffer complexity). Also, we now initialize the audio device manager at a specific sampleRate and # of channels correctly. Removed 'latency' adjustment in PrivatePlayer (no longer needed with no read-ahead buffer). Increased the min_frames_required on the video cache to 24.
2022-01-31 15:18:07 -06:00
Jonathan Thomas
133bae40c3
Adding pre-roll to VideoCacheThread, and making video & audio threads wait for the isReady() method before playing. Also fixed an audio bug where our internal buffer was not being cleared on seek. Removed some unused caching from Clip, and did some minor refactor on FrameMapper/Clip cache clearing.
2022-01-26 17:56:33 -06:00
Jonathan Thomas
f1c2cc06de
Adding ability to open *.osp files in QtPlayer app.
2022-01-26 15:12:15 -06:00
Jonathan Thomas
c55b644f70
Refactoring video playback timing to use absolute timestamps and predicted frame times, instead of relative sleep. Adjusting audio buffer smaller (less latency).
2022-01-18 13:08:32 -06:00
Jonathan Thomas
4d3aab8206
Merge remote-tracking branch 'origin/caching-timing-improvements' into caching-timing-improvements
...
# Conflicts:
# src/Qt/PlayerPrivate.cpp
2022-01-17 14:55:25 -06:00
Jonathan Thomas
84eb008109
Using more aggressive adjustment increment, and adding DEBUG output
2022-01-17 14:53:39 -06:00
jackson
a42f82b7a9
add logging file
2022-01-15 02:14:38 -06:00
Jonathan Thomas
a5f35fb42a
Refactoring the VideoCacheThread to check every frame before requesting it. Adding a new method: Contains() to our cache objects, to facilitate this. Removing cache clearning experimental code from Timeline (causing playback issues). Refactoring PrivatePlayer playback timing code, to calculate an average # of frame difference between audio and video threads, and slowly adjust back towards zero when needed.
2022-01-14 15:16:04 -06:00
FeRD (Frank Dana)
8344e5c7a1
FrameMapper: Reformat logging calls
2022-01-12 11:02:52 -05:00
FeRD (Frank Dana)
549149d657
src/Qt/*: Reformat logging calls, fix indents
2022-01-12 11:02:52 -05:00
FeRD (Frank Dana)
806052f9c8
Clip, Timeline: Reformat logging calls
2022-01-12 11:02:52 -05:00
FeRD (Frank Dana)
3b1d4102af
FFmpegWriter: Format ZmqLogger calls, move headers
2022-01-12 11:02:52 -05:00