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.
This commit is contained in:
Max Kellermann
2017-11-14 11:30:28 +01:00
parent 31ab78ae8e
commit aea37e46e3
3 changed files with 6 additions and 4 deletions

View File

@@ -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;