changeset 1277:13701ab9d2c7 3.0-integration

Actually use the StorageAdviser output properly
author Chris Cannam
date Tue, 22 Nov 2016 16:40:14 +0000
parents adbd16d2c1e8
children 0be27c989c1d
files data/fileio/AudioFileReaderFactory.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.cpp	Tue Nov 22 16:39:29 2016 +0000
+++ b/data/fileio/AudioFileReaderFactory.cpp	Tue Nov 22 16:40:14 2016 +0000
@@ -115,8 +115,8 @@
         size_t kb = (estimatedSamples * sizeof(float)) / 1024;
         StorageAdviser::Recommendation rec =
             StorageAdviser::recommend(StorageAdviser::SpeedCritical, kb, kb);
-        if (rec == StorageAdviser::UseMemory ||
-            rec == StorageAdviser::PreferMemory) {
+        if ((rec & StorageAdviser::UseMemory) ||
+            (rec & StorageAdviser::PreferMemory)) {
             cacheMode = CodedAudioFileReader::CacheInMemory;
         }
     }