testing paste hang fix

This commit is contained in:
itsmattkc
2018-06-22 22:15:08 -07:00
parent 58736bd243
commit 1200eacd50
5 changed files with 53 additions and 50 deletions
+5 -6
View File
@@ -302,9 +302,7 @@ void open_clip_worker(Clip* clip) {
clip->frame = av_frame_alloc();
qDebug() << "[INFO] Clip opened on track" << clip->track;
clip->open = true;
qDebug() << "[INFO] Clip opened on track" << clip->track;
}
void cache_clip_worker(Clip* clip, long playhead, bool write_A, bool write_B, bool reset) {
@@ -369,12 +367,13 @@ void close_clip_worker(Clip* clip) {
void Cacher::run() {
// open_lock is used to prevent the clip from being destroyed before the cacher has closed it properly
clip->open = true;
caching = true;
clip->open_lock.lock();
open_clip_worker(clip);
caching = true;
while (true) {
while (caching) {
clip->can_cache.wait(&clip->lock);
if (!caching) {
break;
@@ -383,7 +382,7 @@ void Cacher::run() {
}
}
close_clip_worker(clip);
close_clip_worker(clip);
clip->lock.unlock();
clip->open_lock.unlock();
+1 -1
View File
@@ -40,7 +40,7 @@ void handle_media(Sequence* sequence, long playhead, bool multithreaded) {
open_clip(c, multithreaded);
// add to current_clips, (insertion) sorted by track so composite them in order
cc_lock.lock();
cc_lock.lock();
bool found = false;
for (int j=0;j<current_clips.size();j++) {
if (current_clips[j]->track < c->track) {