diff options
author | Robin Gareus <robin@gareus.org> | 2018-11-22 20:36:41 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-11-22 20:36:41 +0100 |
commit | 7ed37d67ff7aa83b5f12dc6fcef73b28a97de1b3 (patch) | |
tree | 4b023f7b1b7391c2d7efe9ac59cf3b43ff387cef /libs | |
parent | e297951b3080bedab8c4cba415178ecdef8e1fb2 (diff) |
Backwards compatible sndfile support
SFC_SET_COMPRESSION_LEVEL was only added in 2012 and only available in
libsndfile 1.0.26 or later.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/export_graph_builder.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index f9b9ad1b56..dad0f47219 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -307,10 +307,13 @@ ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::Sndfil writer.reset (new AudioGrapher::SndfileWriter<T> (writer_filename, format, channels, config.format->sample_rate(), config.broadcast_info)); writer->FileWritten.connect_same_thread (copy_files_connection, boost::bind (&ExportGraphBuilder::Encoder::copy_files, this, _1)); if (format & ExportFormatBase::SF_Vorbis) { - /* libsndfile uses range 0..1 (best .. worst) */ + /* libsndfile uses range 0..1 (worst.. best) for + * SFC_SET_VBR_ENCODING_QUALITY and maps + * SFC_SET_COMPRESSION_LEVEL = 1.0 - VBR_ENCODING_QUALITY + */ double vorbis_quality = 1.0 - config.format->codec_quality () / 100.f; if (vorbis_quality >= 0 && vorbis_quality <= 1.0) { - writer->command (SFC_SET_COMPRESSION_LEVEL, &vorbis_quality, sizeof (double)); + writer->command (SFC_SET_VBR_ENCODING_QUALITY, &vorbis_quality, sizeof (double)); } } } |