Prepare export-format codec-quality setting
[ardour.git] / libs / ardour / export_graph_builder.cc
index b2eaafce21dc7aa3004110772c57ffa4af6f9702..e190791291b8f5288fae3c2214760b5b15d26f36 100644 (file)
@@ -322,7 +322,7 @@ ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::CmdPip
                throw ExportFailed ("External encoder (ffmpeg) is not available.");
        }
 
-       int quality = 3; // TODO get from config.format
+       int quality = config.format->codec_quality ();
 
        int a=0;
        char **argp = (char**) calloc (100, sizeof(char*));
@@ -342,9 +342,9 @@ ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::CmdPip
        argp[a++] = strdup ("pipe:0");
 
        argp[a++] = strdup ("-y");
-       if (quality < 10) {
+       if (quality <0) {
                /* variable rate, lower is better */
-               snprintf (tmp, sizeof(tmp), "%d", quality);
+               snprintf (tmp, sizeof(tmp), "%d", -quality);
                argp[a++] = strdup ("-q:a"); argp[a++] = strdup (tmp);
        } else {
                /* fixed bitrate, higher is better */