jkl playback is functional

This commit is contained in:
itsmattkc
2019-01-23 18:57:52 +11:00
parent 0e3250fb59
commit 8462301caf
15 changed files with 162 additions and 63 deletions
+6 -5
View File
@@ -105,18 +105,19 @@ void close_clip(Clip* clip, bool wait) {
}
}
void cache_clip(Clip* clip, long playhead, bool reset, bool scrubbing, QVector<Clip*>& nests) {
void cache_clip(Clip* clip, long playhead, bool reset, bool scrubbing, QVector<Clip*>& nests, int playback_speed) {
if (clip_uses_cacher(clip)) {
if (clip->multithreaded) {
clip->cacher->playhead = playhead;
clip->cacher->reset = reset;
clip->cacher->nests = nests;
clip->cacher->scrubbing = scrubbing;
clip->cacher->playback_speed = playback_speed;
if (reset && clip->queue.size() > 0) clip->cacher->interrupt = true;
clip->can_cache.wakeAll();
} else {
cache_clip_worker(clip, playhead, reset, scrubbing, nests);
cache_clip_worker(clip, playhead, reset, scrubbing, nests, playback_speed);
}
}
}
@@ -264,13 +265,13 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) {
uint8_t* data_buffer_1 = target_frame->data[0];
uint8_t* data_buffer_2 = nullptr;
int frame_size;
size_t frame_size;
for (int i=0;i<c->effects.size();i++) {
Effect* e = c->effects.at(i);
if (e->enable_image && e->is_enabled()) {
if (data_buffer_1 == target_frame->data[0]) {
frame_size = target_frame->linesize[0]*target_frame->height;
frame_size = size_t(target_frame->linesize[0])*size_t(target_frame->height);
data_buffer_1 = new uint8_t[frame_size];
data_buffer_2 = new uint8_t[frame_size];
@@ -296,7 +297,7 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) {
// get more frames
QVector<Clip*> empty;
if (cache) cache_clip(c, playhead, reset, false, empty);
if (cache) cache_clip(c, playhead, reset, false, empty, false);
}
}