diff --git a/darkice/trunk/configure.in b/darkice/trunk/configure.in index e359dcb..efd7205 100644 --- a/darkice/trunk/configure.in +++ b/darkice/trunk/configure.in @@ -260,10 +260,11 @@ dnl make sure at least one of lame and vorbis present dnl----------------------------------------------------------------------------- if test "x${LAME_LDFLAGS}" = "x" \ -a "x${VORBIS_LDFLAGS}" = "x" \ + -a "x${OPUS_LDFLAGS}" = "x" \ -a "x${FAAC_LDFLAGS}" = "x" \ -a "x${AACPLUS_LDFLAGS}" = "x" \ -a "x${TWOLAME_LDFLAGS}" = "x"; then - AC_MSG_ERROR([neither lame, Ogg Vorbis, faac, aac+ nor twolame configured]) + AC_MSG_ERROR([neither lame, Ogg Vorbis, opus, faac, aac+ nor twolame configured]) fi diff --git a/darkice/trunk/src/OpusLibEncoder.cpp b/darkice/trunk/src/OpusLibEncoder.cpp index 3a56988..d1d2934 100644 --- a/darkice/trunk/src/OpusLibEncoder.cpp +++ b/darkice/trunk/src/OpusLibEncoder.cpp @@ -36,6 +36,9 @@ // compile only if configured for Ogg / Opus #ifdef HAVE_OPUS_LIB +#include +#include +#include #include "Exception.h" #include "Util.h" @@ -474,10 +477,10 @@ OpusLibEncoder :: flush ( void ) int opusBufferSize = (1275*3+7)*getOutChannel(); unsigned char * opusBuffer = new unsigned char[opusBufferSize]; - short int * shortBuffer = new short int[480]; + short int * shortBuffer = new short int[480*getInChannel()]; // Send an empty audio packet along to flush out the stream. - memset( shortBuffer, 0, 480); + memset( shortBuffer, 0, 480*getInChannel()*sizeof(*shortBuffer)); memset( opusBuffer, 0, opusBufferSize); int encBytes = opus_encode( opusEncoder, shortBuffer, 480, opusBuffer, opusBufferSize); if( encBytes == -1 ) { diff --git a/darkice/trunk/src/OpusLibEncoder.h b/darkice/trunk/src/OpusLibEncoder.h index 5bfc928..b2a6904 100644 --- a/darkice/trunk/src/OpusLibEncoder.h +++ b/darkice/trunk/src/OpusLibEncoder.h @@ -40,6 +40,8 @@ #include "config.h" #endif +#include + #ifdef HAVE_OPUS_LIB #include #include