From c85450648fbf23fae6e427fe9cf28e77367fe811 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 30 Dec 2016 17:55:46 -0500 Subject: [PATCH] Fix: make sure copies have proper event lengths. Also made it much clearer what's going on with the initial copy to the heap. --- Storage/Disk/PCMSegment.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Storage/Disk/PCMSegment.cpp b/Storage/Disk/PCMSegment.cpp index cdde8024d..59953ee6a 100644 --- a/Storage/Disk/PCMSegment.cpp +++ b/Storage/Disk/PCMSegment.cpp @@ -11,10 +11,8 @@ using namespace Storage::Disk; PCMSegmentEventSource::PCMSegmentEventSource(const PCMSegment &segment) : - segment_(new PCMSegment) + segment_(new PCMSegment(segment)) { - *segment_ = segment; - // add an extra bit of storage at the bottom if one is going to be needed; // events returned are going to be in integral multiples of the length of a bit // other than the very first and very last which will include a half bit length @@ -35,6 +33,9 @@ PCMSegmentEventSource::PCMSegmentEventSource(const PCMSegmentEventSource &origin { // share underlying data with the original segment_ = original.segment_; + + // load up the clock rate and set initial conditions + next_event_.length.clock_rate = segment_->length_of_a_bit.clock_rate; reset(); }