File tree Expand file tree Collapse file tree
Source/Processors/RecordNode/BinaryFormat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,31 +8,30 @@ class FileMemoryBlock
88 m_data (blockSize, true ),
99 m_file (file),
1010 m_blockSize (blockSize),
11- m_offset (offset)
11+ m_offset (offset),
12+ m_finalFlushSamples (blockSize)
1213 {};
1314
1415 ~FileMemoryBlock () {
1516 if (~m_flushed)
1617 {
17- m_file->write (m_data, m_blockSize *sizeof (StorageType));
18+ m_file->write (m_data, m_finalFlushSamples *sizeof (StorageType));
1819 }
1920 };
2021
2122 inline uint64 getOffset () { return m_offset; }
2223 inline StorageType* getData () { return m_data.getData (); }
23- void partialFlush (size_t size, bool markFlushed = true )
24+ void partialFlush (size_t size)
2425 {
25- // std::cout << "[RN] flushing last block " << size << std::endl;
26- m_file->write (m_data, size*sizeof (StorageType));
27- if (markFlushed)
28- m_flushed = true ;
26+ m_finalFlushSamples = size;
2927 }
3028
3129private:
3230 HeapBlock<StorageType> m_data;
3331 FileOutputStream* const m_file;
3432 const int m_blockSize;
3533 const uint64 m_offset;
34+ size_t m_finalFlushSamples;
3635 bool m_flushed{ false };
3736 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileMemoryBlock);
38- };
37+ };
You can’t perform that action at this time.
0 commit comments