Permalink
Browse files

o Uh, log() is actually ln() and log10f() is log() :)

  • Loading branch information...
1 parent 26fd15a commit 7b499ea667ca25ffe848efcc10fa3c0688fc23e6 @hzeller committed Sep 22, 2012
Showing with 9 additions and 7 deletions.
  1. +1 −1 README.md
  2. +7 −5 folve-filesystem.cc
  3. +1 −1 status-server.cc
View
@@ -7,7 +7,7 @@ Overview
This fuse filesystem takes an original path to a directory with flac-files
and provides these files at the mount point. Accessing audio files will
-automatically convolve these on-the-fly using the zita convolver by
+automatically convolve these on-the-fly using the FIR zita convolver by
Fons Adriaensen. You can directly use filter configuration files that you have
for jconvolver/fconvolver (files in this directory starting with zita-* are
imported from his jconvolver project to parse the same configuration files).
View
@@ -180,7 +180,6 @@ class SndFileHandler :
virtual ~SndFileHandler() {
Close();
- delete processor_;
delete output_buffer_;
}
@@ -357,9 +356,10 @@ class SndFileHandler :
return false; // We already have one.
}
// TODO: check that other parameters such as sampling rate and channels
- // match (should be a are problem).
+ // match (should be a rare problem as files in one dir typically match).
processor_ = processor;
if (!processor_->is_input_buffer_complete()) {
+ // Fill with our beginning so that the donor can finish its processing.
input_frames_left_ -= processor_->FillBuffer(snd_in_);
}
base_stats_.in_gapless = true;
@@ -430,7 +430,7 @@ class SndFileHandler :
processor_->WriteProcessed(snd_out_, r);
if (passed_processor) {
base_stats_.out_gapless = true;
- ExtractOutputValues();
+ SaveOutputValues();
processor_ = NULL; // we handed over ownership.
}
if (next_file) fs_->Close(found->c_str(), next_file);
@@ -513,7 +513,7 @@ class SndFileHandler :
}
}
- void ExtractOutputValues() {
+ void SaveOutputValues() {
if (processor_) {
base_stats_.max_output_value = processor_->max_output_value();
processor_->ResetMaxValues();
@@ -522,13 +522,15 @@ class SndFileHandler :
void Close() {
if (snd_out_ == NULL) return; // done.
- ExtractOutputValues();
+ SaveOutputValues();
if (base_stats_.max_output_value > 1.0) {
syslog(LOG_ERR, "Observed output clipping in '%s': "
"Max=%.3f; Multiply gain with <= %.5f in %s",
base_stats_.filename.c_str(), base_stats_.max_output_value,
1.0 / base_stats_.max_output_value, config_path_.c_str());
}
+ delete processor_;
+ processor_ = NULL;
// We can't disable buffer writes here, because outfile closing will flush
// the last couple of sound samples.
if (snd_in_) sf_close(snd_in_);
View
@@ -190,7 +190,7 @@ static void AppendFileInfo(std::string *result, const char *progress_style,
if (stats.max_output_value > 1e-6) {
Appendf(result, sDecibelColumn,
stats.max_output_value > 1.0 ? "#FF0505" : "white",
- 20 * logf(stats.max_output_value));
+ 20 * log10f(stats.max_output_value));
} else {
result->append("<td>-</td>");
}

0 comments on commit 7b499ea

Please sign in to comment.