summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/audiocachefile.cc6
-rw-r--r--test/audiocachefiletest.cc8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/audiocachefile.cc b/src/audiocachefile.cc
index 3d566e7..0955b25 100644
--- a/src/audiocachefile.cc
+++ b/src/audiocachefile.cc
@@ -38,7 +38,7 @@ AudioCacheFile::AudioCacheFile(const std::string& filename,
std::vector<sample_t>& read_buffer)
: filename(filename), read_buffer(read_buffer)
{
- std::memset(&sf_info, 0, sizeof(SF_INFO)); // XXX Is this really necessary?
+ std::memset(&sf_info, 0, sizeof(SF_INFO));
fh = sf_open(filename.c_str(), SFM_READ, &sf_info);
if(!fh)
@@ -50,7 +50,7 @@ AudioCacheFile::AudioCacheFile(const std::string& filename,
if(sf_info.frames == 0)
{
- printf("sf_info.frames == 0\n"); // XXX Shouldn't that be debug output?
+ WARN(cache, "sf_info.frames == 0\n");
}
}
@@ -135,7 +135,7 @@ AudioCacheFile& AudioCacheFiles::getFile(const std::string& filename)
auto it = audiofiles.find(filename);
if(it == audiofiles.end())
{
- cacheAudioFile = new AudioCacheFile(filename, read_buffer); // XXX why create a pointer and not move it into the map such that it is the owner?
+ cacheAudioFile = new AudioCacheFile(filename, read_buffer);
audiofiles.insert(std::make_pair(filename, cacheAudioFile));
}
else
diff --git a/test/audiocachefiletest.cc b/test/audiocachefiletest.cc
index 98b7ab5..b7839b7 100644
--- a/test/audiocachefiletest.cc
+++ b/test/audiocachefiletest.cc
@@ -92,7 +92,9 @@ public:
ref_file[c]->load();
}
- AudioCacheFile file(filename);
+ std::vector<sample_t> read_buffer;
+
+ AudioCacheFile file(filename, read_buffer);
CPPUNIT_ASSERT_EQUAL(filename, file.getFilename());
CPPUNIT_ASSERT_EQUAL(13, (int)file.getChannelCount()); // Sanity check
@@ -188,7 +190,9 @@ public:
size_t buffer_size = 64;
std::string filename = "kits/no-such-file.wav";
- AudioCacheFile file(filename);
+ std::vector<sample_t> read_buffer;
+
+ AudioCacheFile file(filename, read_buffer);
CPPUNIT_ASSERT_EQUAL(filename, file.getFilename());
CPPUNIT_ASSERT_EQUAL(0u, (unsigned int)file.getSize());
CPPUNIT_ASSERT_EQUAL(0u, (unsigned int)file.getChannelCount());