Skip to content

Commit

Permalink
Merge pull request #513 from jeffski/set-constructor-clip
Browse files Browse the repository at this point in the history
Set clip in constructor to resolve scale crop issue
  • Loading branch information
ferdnyc committed May 22, 2020
2 parents 25ca2d0 + 5b5950c commit 2e3181f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Clip.cpp
Expand Up @@ -148,8 +148,11 @@ Clip::Clip(ReaderBase* new_reader) : resampler(NULL), reader(new_reader), alloca
Open();
Close();

// Update duration
End(reader->info.duration);
// Update duration and set parent
if (reader) {
End(reader->info.duration);
reader->SetClip(this);
}
}

// Constructor with filepath
Expand Down Expand Up @@ -202,9 +205,10 @@ Clip::Clip(std::string path) : resampler(NULL), reader(NULL), allocated_reader(N
}
}

// Update duration
// Update duration and set parent
if (reader) {
End(reader->info.duration);
reader->SetClip(this);
allocated_reader = reader;
init_reader_rotation();
}
Expand Down

0 comments on commit 2e3181f

Please sign in to comment.