Checks if the SampleBuffer is valid before trying to extract its
packed data. If it is not valid Olive writes blank segments instead.
This commit is contained in:
Thomas Wilshaw
2020-10-13 12:19:06 +01:00
parent 6ced8504d6
commit b676f2f8b6
+5 -2
View File
@@ -75,8 +75,11 @@ void AudioPlaybackCache::WritePCM(const TimeRange &range, SampleBufferPtr sample
segment_length_ += seg_sz; segment_length_ += seg_sz;
} }
// Convert to packed data, which is what we store on disk QByteArray a;
QByteArray a = samples->toPackedData(); if (samples) {
// Convert to packed data, which is what we store on disk
a = samples->toPackedData();
}
// Keep track of validated ranges so we can signal them all at once at the end // Keep track of validated ranges so we can signal them all at once at the end
TimeRangeList ranges_we_validated; TimeRangeList ranges_we_validated;