From aea37e46e3e26183dd94479ec941bfb14acd89e6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Nov 2017 11:30:28 +0100 Subject: [PATCH] encoder/vorbis: default to quality 3 Don't require a quality or bitrate setting. If nothing is set, don't fail startup - just go with a good default. A quality setting of 3 is what "oggenc" defaults to as well. --- NEWS | 2 ++ doc/user.xml | 4 ++-- src/encoder/plugins/VorbisEncoderPlugin.cxx | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index c961c25db..04b7da8d4 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ ver 0.20.12 (not yet released) - vorbis: fix Tremor support * player - log message when decoder is too slow +* encoder + - vorbis: default to quality 3 * output - fix hanging playback with soxr resampler diff --git a/doc/user.xml b/doc/user.xml index e010d5e3e..5cc741227 100644 --- a/doc/user.xml +++ b/doc/user.xml @@ -3068,8 +3068,8 @@ run Sets the quality for VBR. -1 is the lowest quality, - 10 is the highest quality. Cannot be used with - bitrate. + 10 is the highest quality. Defaults to 3. Cannot + be used with bitrate. diff --git a/src/encoder/plugins/VorbisEncoderPlugin.cxx b/src/encoder/plugins/VorbisEncoderPlugin.cxx index 68ea479ee..5a8e2826a 100644 --- a/src/encoder/plugins/VorbisEncoderPlugin.cxx +++ b/src/encoder/plugins/VorbisEncoderPlugin.cxx @@ -62,7 +62,7 @@ private: }; class PreparedVorbisEncoder final : public PreparedEncoder { - float quality; + float quality = 3; int bitrate; public: @@ -97,7 +97,7 @@ PreparedVorbisEncoder::PreparedVorbisEncoder(const ConfigBlock &block) value = block.GetBlockValue("bitrate"); if (value == nullptr) - throw std::runtime_error("neither bitrate nor quality defined"); + return; quality = -2.0;