summaryrefslogtreecommitdiff
path: root/libs/ardour/sndfilesource.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-10-02 20:40:44 +0200
committerRobin Gareus <robin@gareus.org>2017-10-03 02:22:42 +0200
commitdf83c0381e126f17d59039ab8b61789bfe27a79f (patch)
tree9ee98b2ce0d50aeee2545346956a511582e6dbf1 /libs/ardour/sndfilesource.cc
parent86d3735ea89504dfb280a6a435794383af482841 (diff)
Prepare support for compression levels (archive + flac)
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r--libs/ardour/sndfilesource.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 9c49e1e1fb..c69325741e 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -276,6 +276,21 @@ SndFileSource::SndFileSource (Session& s, const AudioFileSource& other, const st
throw failed_constructor();
}
+#if 0
+ /* setting flac compression quality above the default does not produce a significant size
+ * improvement (not for large raw recordings anyway, the_CLA tests 2017-10-02, >> 250MB files,
+ * ~1% smaller), but does have a significant encoding speed penalty.
+ *
+ * We still may expose this as option someday though, perhaps for opposite reason: "fast encoding"
+ */
+ double flac_quality = 1; // libsndfile uses range 0..1 (mapped to flac 0..8), default is (5/8)
+ if (sf_command (_sndfile, SFC_SET_COMPRESSION_LEVEL, &flac_quality, sizeof (double)) != SF_TRUE) {
+ char errbuf[256];
+ sf_error_str (_sndfile, errbuf, sizeof (errbuf) - 1);
+ error << string_compose (_("Cannot set flac compression level: %1"), errbuf) << endmsg;
+ }
+#endif
+
Sample buf[8192];
samplecnt_t off = 0;
float peak = 0;