From 921e519555ec923e0699fd8f45fb6e53c69c8591 Mon Sep 17 00:00:00 2001 From: "rafael@riseup.net" Date: Sun, 19 May 2013 18:12:48 +0000 Subject: [PATCH] fix for Opus --- darkice/trunk/src/OpusLibEncoder.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/darkice/trunk/src/OpusLibEncoder.cpp b/darkice/trunk/src/OpusLibEncoder.cpp index 65d4ccc..7fc73dd 100644 --- a/darkice/trunk/src/OpusLibEncoder.cpp +++ b/darkice/trunk/src/OpusLibEncoder.cpp @@ -135,11 +135,6 @@ OpusLibEncoder :: init ( unsigned int outMaxBitrate ) #endif } - int bufferSize = (getInBitsPerSample()/8) * getInChannel() * 480; - internalBuffer = new unsigned char[bufferSize]; - internalBufferLength = 0; - memset( internalBuffer, 0, bufferSize); - encoderOpen = false; } @@ -163,6 +158,11 @@ OpusLibEncoder :: open ( void ) "opus lib opening underlying sink error"); } + int bufferSize = (getInBitsPerSample()/8) * getInChannel() * 480; + internalBuffer = new unsigned char[bufferSize]; + internalBufferLength = 0; + memset( internalBuffer, 0, bufferSize); + int err; opusEncoder = opus_encoder_create( getOutSampleRate(), getInChannel(),