fixed linking bug

This commit is contained in:
itsmattkc
2018-07-18 13:17:14 +01:00
parent de46eb861b
commit 5e70fd4534
7 changed files with 55 additions and 36 deletions
+23 -21
View File
@@ -64,27 +64,29 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
QTreeWidgetItem* item = items.at(i);
if (panel_project->get_type_from_tree(item) == MEDIA_TYPE_FOOTAGE) {
Media* m = panel_project->get_media_from_tree(item);
Ghost g;
g.clip = -1;
g.media = m;
g.old_clip_in = g.clip_in = 0;
g.in = entry_point;
if (m->video_tracks.size() > 0 && m->video_tracks[0]->infinite_length && m->audio_tracks.size() == 0) {
g.out = g.in + 100;
} else {
g.out = entry_point + m->get_length_in_frames(sequence->frame_rate);
}
entry_point = g.out;
g.trimming = false;
for (int j=0;j<m->audio_tracks.size();j++) {
g.track = j;
g.media_stream = m->audio_tracks.at(j);
panel_timeline->ghosts.append(g);
}
for (int j=0;j<m->video_tracks.size();j++) {
g.track = -1-j;
g.media_stream = m->video_tracks.at(j);
panel_timeline->ghosts.append(g);
if (m->ready) {
Ghost g;
g.clip = -1;
g.media = m;
g.old_clip_in = g.clip_in = 0;
g.in = entry_point;
if (m->video_tracks.size() > 0 && m->video_tracks[0]->infinite_length && m->audio_tracks.size() == 0) {
g.out = g.in + 100;
} else {
g.out = entry_point + m->get_length_in_frames(sequence->frame_rate);
}
entry_point = g.out;
g.trimming = false;
for (int j=0;j<m->audio_tracks.size();j++) {
g.track = j;
g.media_stream = m->audio_tracks.at(j);
panel_timeline->ghosts.append(g);
}
for (int j=0;j<m->video_tracks.size();j++) {
g.track = -1-j;
g.media_stream = m->video_tracks.at(j);
panel_timeline->ghosts.append(g);
}
}
}
}
+1 -1
View File
@@ -73,7 +73,7 @@ void ViewerWidget::paintGL() {
// if clip starts within one second and/or hasn't finished yet
if (c != NULL) {
if (is_clip_active(c, panel_timeline->playhead)) {
if (c->media->ready && is_clip_active(c, panel_timeline->playhead)) {
// if thread is already working, we don't want to touch this,
// but we also don't want to hang the UI thread
if (!c->open) {