From ab48aa307122ec5da5cca733c922f8c16d3b5673 Mon Sep 17 00:00:00 2001 From: "rafael@riseup.net" Date: Wed, 11 Dec 2013 01:08:05 +0000 Subject: [PATCH] fixed issue 98 --- darkice/trunk/src/VorbisLibEncoder.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/darkice/trunk/src/VorbisLibEncoder.cpp b/darkice/trunk/src/VorbisLibEncoder.cpp index 2ea0565..e4a7456 100644 --- a/darkice/trunk/src/VorbisLibEncoder.cpp +++ b/darkice/trunk/src/VorbisLibEncoder.cpp @@ -40,7 +40,7 @@ #include "Exception.h" #include "Util.h" #include "VorbisLibEncoder.h" - +#define VORBIS_MIN_BITRATE 45 /* =================================================== local data structures */ @@ -79,6 +79,15 @@ VorbisLibEncoder :: init ( unsigned int outMaxBitrate ) getInChannel() ); } + if ( getOutBitrateMode() == abr || getOutBitrateMode() == cbr ) { + if ( getOutBitrate() < VORBIS_MIN_BITRATE ) { + throw Exception( __FILE__, __LINE__, + "output bitrate is lower than libvorbis minimum", + getOutBitrate() ); + } + + } + if ( getOutSampleRate() == getInSampleRate() ) { resampleRatio = 1; converter = 0;