fixed issue 98

This commit is contained in:
rafael@riseup.net 2013-12-11 01:08:05 +00:00
parent e0cad73a68
commit ab48aa3071
1 changed files with 10 additions and 1 deletions

View File

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