From 5b5950c9913501bfe11feacac32e4a0bdc4ce568 Mon Sep 17 00:00:00 2001 From: Jeff Shillitto Date: Tue, 19 May 2020 19:57:06 +1000 Subject: [PATCH] use reader instead of new_reader --- src/Clip.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Clip.cpp b/src/Clip.cpp index cdb83cdc..fa1bb7c7 100644 --- a/src/Clip.cpp +++ b/src/Clip.cpp @@ -148,11 +148,10 @@ Clip::Clip(ReaderBase* new_reader) : resampler(NULL), reader(new_reader), alloca Open(); Close(); - // Update duration - End(reader->info.duration); - - if (new_reader) { - new_reader->SetClip(this); + // Update duration and set parent + if (reader) { + End(reader->info.duration); + reader->SetClip(this); } } @@ -206,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(); }