cachetask: write silence if no samples are returned
Fixes segfault trying to access a null sample buffer.
This commit is contained in:
Vendored
+5
-1
@@ -71,7 +71,11 @@ void CacheTask::FrameDownloaded(const QByteArray &hash, const std::list<rational
|
||||
|
||||
void CacheTask::AudioDownloaded(const TimeRange &range, SampleBufferPtr samples)
|
||||
{
|
||||
viewer()->audio_playback_cache()->WritePCM(range, samples);
|
||||
if (samples) {
|
||||
viewer()->audio_playback_cache()->WritePCM(range, samples);
|
||||
} else {
|
||||
viewer()->audio_playback_cache()->WriteSilence(range);
|
||||
}
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
Reference in New Issue
Block a user