View | Details | Raw Unified | Return to bug 153519
Collapse All | Expand All

(-)audio/darkice/Makefile (-3 / +7 lines)
Lines 8-28 Link Here
8
PORTNAME=	darkice
8
PORTNAME=	darkice
9
PORTVERSION=	1.0
9
PORTVERSION=	1.0
10
PORTREVISION=	2
10
PORTREVISION=	3
11
CATEGORIES=	audio net
11
CATEGORIES=	audio net
12
MASTER_SITES=	GOOGLE_CODE
12
MASTER_SITES=	GOOGLE_CODE
13
MAINTAINER=	ports@FreeBSD.org
13
MAINTAINER=	ports@FreeBSD.org
14
COMMENT=	An IceCast, IceCast2 and ShoutCast live audio streamer
14
COMMENT=	An IceCast, IceCast2 and ShoutCast live audio streamer
15
LICENSE=	GPLv3
16
LICENSE_FILE=	${WRKSRC}/COPYING
17
15
OPTIONS=	VORBIS "Ogg Vorbis support" on \
18
OPTIONS=	VORBIS "Ogg Vorbis support" on \
16
		LAME "LAME support for MP3" off \
19
		LAME "LAME support for MP3" off \
17
		TWOLAME "TwoLAME support for MP2" off \
20
		TWOLAME "TwoLAME support for MP2" off \
18
		FAAC "FAAC support for AAC" off \
21
		FAAC "FAAC support for AAC" off \
19
		JACK "Jack support" off \
22
		JACK "Jack support" off \
20
		AACPLUS "AAC HEv2 support" off \
23
		AACPLUS "AAC HEv2 support (required for use SAMPLERATE)" off \
21
		SAMPLERATE "Libsamplerate support" off
24
		SAMPLERATE "Libsamplerate support" off
25
USE_AUTOTOOLS=	aclocal autoconf
22
GNU_CONFIGURE=	yes
26
GNU_CONFIGURE=	yes
23
CONFIGURE_ENV=	CPPFLAGS="${PTHREAD_CFLAGS}" LDFLAGS="${PTHREAD_LIBS}" \
27
CONFIGURE_ENV=	CPPFLAGS="${PTHREAD_CFLAGS}" LDFLAGS="${PTHREAD_LIBS}" \
24
		ac_cv_prog_acx_pthread_config=no
28
		ac_cv_prog_acx_pthread_config=no
Lines 73-79 Link Here
73
.endif
77
.endif
74
.if defined(WITH_AACPLUS)
78
.if defined(WITH_AACPLUS)
75
LIB_DEPENDS+=	aacplus.1:${PORTSDIR}/audio/libaacplus
79
LIB_DEPENDS+=	aacplus.2:${PORTSDIR}/audio/libaacplus
76
CONFIGURE_ARGS+=	--with-aacplus-prefix=${LOCALBASE}
80
CONFIGURE_ARGS+=	--with-aacplus-prefix=${LOCALBASE}
77
.else
81
.else
78
CONFIGURE_ARGS+=	--without-aacplus
82
CONFIGURE_ARGS+=	--without-aacplus
(-)audio/darkice/distinfo (-1 lines)
Lines 1-3 Link Here
1
MD5 (darkice-1.0.tar.gz) = 1804e63d42a9703d01fe378c9a77c473
2
SHA256 (darkice-1.0.tar.gz) = 61a05c4dab206c22c3e3d5570ee4841f9c8875241098adf687717e7dcc6df332
1
SHA256 (darkice-1.0.tar.gz) = 61a05c4dab206c22c3e3d5570ee4841f9c8875241098adf687717e7dcc6df332
3
SIZE (darkice-1.0.tar.gz) = 311567
2
SIZE (darkice-1.0.tar.gz) = 311567
(-)audio/darkice/files/patch-configure.in (+11 lines)
Line 0 Link Here
1
--- configure.in.orig	2010-05-10 06:38:57.000000000 +0900
2
+++ configure.in	2010-12-29 19:11:40.000000000 +0900
3
@@ -166,7 +166,7 @@
4
5
 if test "x${USE_AACPLUS}" = "xyes" ; then
6
     AC_MSG_CHECKING( [for aacplus library at ${CONFIG_AACPLUS_PREFIX}] )
7
-    LA_SEARCH_LIB( AACPLUS_LIB_LOC, AACPLUS_INC_LOC, libaacplus.a libaacplus.so, sbr_main.h,
8
+    LA_SEARCH_LIB( AACPLUS_LIB_LOC, AACPLUS_INC_LOC, libaacplus.a libaacplus.so, aacplus.h,
9
                    ${CONFIG_AACPLUS_PREFIX})
10
     if test "x${AACPLUS_LIB_LOC}" != "x" ; then
11
         AC_DEFINE( HAVE_AACPLUS_LIB, 1, [build with aacplus library] )
(-)audio/darkice/files/patch-darkice.cfg (+10 lines)
Line 0 Link Here
1
--- darkice.cfg.orig	2010-05-10 05:26:19.000000000 +0900
2
+++ darkice.cfg	2010-12-29 19:17:57.000000000 +0900
3
@@ -6,6 +6,7 @@
4
 duration        = 60        # duration of encoding, in seconds. 0 means forever
5
 bufferSecs      = 5         # size of internal slip buffer, in seconds
6
 reconnect       = yes       # reconnect to the server(s) if disconnected
7
+realtime        = yes       # run the encoder with POSIX realtime priority
8
9
 # this section describes the audio input that will be streamed
10
 [input]
(-)audio/darkice/files/patch-src_aacPlusEncoder.cpp (+328 lines)
Line 0 Link Here
1
--- src/aacPlusEncoder.cpp.orig	2010-05-10 07:18:48.000000000 +0900
2
+++ src/aacPlusEncoder.cpp	2010-10-13 07:42:25.000000000 +0900
3
@@ -5,8 +5,8 @@
4
    Tyrell DarkIce
5
6
    File     : aacPlusEncoder.cpp
7
-   Version  : $Revision: 474 $
8
-   Author   : $Author: rafael@riseup.net $
9
+   Version  : $Revision$
10
+   Author   : $Author$
11
    Location : $HeadURL$
12
13
    Copyright notice:
14
@@ -51,7 +51,7 @@
15
 /*------------------------------------------------------------------------------
16
  *  File identity
17
  *----------------------------------------------------------------------------*/
18
-static const char fileid[] = "$Id: aacPlusEncoder.cpp 474 2010-05-10 01:18:15Z rafael@riseup.net $";
19
+static const char fileid[] = "$Id$";
20
21
22
 /* ===============================================  local function prototypes */
23
@@ -76,82 +76,27 @@
24
                          "aacplus lib opening underlying sink error");
25
     }
26
27
-    reportEvent(1, "Using aacplus codec version", "720 3gpp");
28
+    reportEvent(1, "Using aacplus codec");
29
30
-    bitrate = getOutBitrate() * 1000;
31
-    bandwidth = 0;
32
-    useParametricStereo = 0;
33
-    numAncDataBytes=0;
34
-    coreWriteOffset = 0;
35
-    envReadOffset = 0;
36
-    writeOffset = INPUT_DELAY*MAX_CHANNELS;
37
-    writtenSamples = 0;
38
-    aacEnc = NULL;
39
-    hEnvEnc=NULL;
40
-
41
-    /* set up basic parameters for aacPlus codec */
42
-    AacInitDefaultConfig(&config);
43
-    nChannelsAAC = nChannelsSBR = getOutChannel();
44
-
45
-    if ( (getInChannel() == 2) && (bitrate >= 16000) && (bitrate < 44001) ) {
46
-        useParametricStereo = 1;
47
-        nChannelsAAC = 1;
48
-        nChannelsSBR = 2;
49
-
50
-        reportEvent(10, "use Parametric Stereo");
51
-
52
-        envReadOffset = (MAX_DS_FILTER_DELAY + INPUT_DELAY)*MAX_CHANNELS;
53
-        coreWriteOffset = CORE_INPUT_OFFSET_PS;
54
-        writeOffset = envReadOffset;
55
-    } else {
56
-    	/* set up 2:1 downsampling */
57
-    	InitIIR21_Resampler(&(IIR21_reSampler[0]));
58
-    	InitIIR21_Resampler(&(IIR21_reSampler[1]));
59
-    	
60
-    	if(IIR21_reSampler[0].delay > MAX_DS_FILTER_DELAY)
61
-    		throw Exception(__FILE__, __LINE__, "IIR21 resampler delay is bigger then MAX_DS_FILTER_DELAY");
62
-        writeOffset += IIR21_reSampler[0].delay*MAX_CHANNELS;
63
+    encoderHandle = aacplusEncOpen(getOutSampleRate(),
64
+                                getInChannel(),
65
+                                &inputSamples,
66
+                                &maxOutputBytes);
67
+
68
+    aacplusEncConfiguration      * aacplusConfig;
69
+
70
+    aacplusConfig = aacplusEncGetCurrentConfiguration(encoderHandle);
71
+
72
+    aacplusConfig->bitRate       = getOutBitrate() * 1000;
73
+    aacplusConfig->bandWidth     = lowpass;
74
+    aacplusConfig->outputFormat  = 1;
75
+    aacplusConfig->inputFormat   = AACPLUS_INPUT_16BIT;
76
+    aacplusConfig->nChannelsOut  = getOutChannel();
77
+
78
+    if (!aacplusEncSetConfiguration(encoderHandle, aacplusConfig)) {
79
+        throw Exception(__FILE__, __LINE__,
80
+                        "error configuring libaacplus library");
81
     }
82
-
83
-    sampleRateAAC = getOutSampleRate();
84
-    config.bitRate = bitrate;
85
-    config.nChannelsIn=getInChannel();
86
-    config.nChannelsOut=nChannelsAAC;
87
-    config.bandWidth=bandwidth;
88
-
89
-    /* set up SBR configuration    */
90
-    if(!IsSbrSettingAvail(bitrate, nChannelsAAC, sampleRateAAC, &sampleRateAAC))
91
-        throw Exception(__FILE__, __LINE__, "No valid SBR configuration found");
92
-
93
-    InitializeSbrDefaults (&sbrConfig);
94
-    sbrConfig.usePs = useParametricStereo;
95
-
96
-    AdjustSbrSettings( &sbrConfig,
97
-                       bitrate,
98
-                       nChannelsAAC,
99
-                       sampleRateAAC,
100
-                       AACENC_TRANS_FAC,
101
-                       24000);
102
-
103
-    EnvOpen( &hEnvEnc,
104
-             inBuf + coreWriteOffset,
105
-             &sbrConfig,
106
-             &config.bandWidth);
107
-
108
-    /* set up AAC encoder, now that samling rate is known */
109
-    config.sampleRate = sampleRateAAC;
110
-    if (AacEncOpen(&aacEnc, config) != 0){
111
-        AacEncClose(aacEnc);
112
-        throw Exception(__FILE__, __LINE__, "Initialisation of AAC failed !");
113
-    }
114
-
115
-    init_plans();
116
-
117
-    /* create the ADTS header */
118
-    adts_hdr(outBuf, &config);
119
-
120
-    inSamples = AACENC_BLOCKSIZE * getInChannel() * 2;
121
-
122
123
     // initialize the resampling coverter if needed
124
     if ( converter ) {
125
@@ -159,8 +104,8 @@
126
         converterData.input_frames   = 4096/((getInBitsPerSample() / 8) * getInChannel());
127
         converterData.data_in        = new float[converterData.input_frames*getInChannel()];
128
         converterData.output_frames  = (int) (converterData.input_frames * resampleRatio + 1);
129
-        if ((int) inSamples >  getInChannel() * converterData.output_frames) {
130
-            resampledOffset       = new float[2 * inSamples];
131
+        if ((int) inputSamples >  getInChannel() * converterData.output_frames) {
132
+            resampledOffset       = new float[2 * inputSamples];
133
         } else {
134
             resampledOffset       = new float[2 * getInChannel() * converterData.input_frames];
135
         }
136
@@ -178,13 +123,9 @@
137
     }
138
139
     aacplusOpen = true;
140
-    reportEvent(10, "bitrate=", bitrate);
141
-    reportEvent(10, "nChannelsIn", getInChannel());
142
-    reportEvent(10, "nChannelsOut", getOutChannel());
143
-    reportEvent(10, "nChannelsSBR", nChannelsSBR);
144
-    reportEvent(10, "nChannelsAAC", nChannelsAAC);
145
-    reportEvent(10, "sampleRateAAC", sampleRateAAC);
146
-    reportEvent(10, "inSamples", inSamples);
147
+    reportEvent(10, "nChannelsAAC", aacplusConfig->nChannelsOut);
148
+    reportEvent(10, "sampleRateAAC", aacplusConfig->sampleRate);
149
+    reportEvent(10, "inSamples", inputSamples);
150
     return true;
151
 }
152
153
@@ -199,21 +140,23 @@
154
     if ( !isOpen() || len == 0) {
155
         return 0;
156
     }
157
-
158
+
159
     unsigned int    channels         = getInChannel();
160
     unsigned int    bitsPerSample    = getInBitsPerSample();
161
     unsigned int    sampleSize       = (bitsPerSample / 8) * channels;
162
+    unsigned char * b                = (unsigned char*) buf;
163
     unsigned int    processed        = len - (len % sampleSize);
164
     unsigned int    nSamples         = processed / sampleSize;
165
-    unsigned int    samples          = (unsigned int) nSamples * channels;
166
-    int processedSamples = 0;
167
-
168
-
169
+    unsigned char * aacplusBuf          = new unsigned char[maxOutputBytes];
170
+    int             samples          = (int) nSamples * channels;
171
+    int             processedSamples = 0;
172
+
173
+
174
175
     if ( converter ) {
176
         unsigned int         converted;
177
 #ifdef HAVE_SRC_LIB
178
-        src_short_to_float_array ((short *) buf, converterData.data_in, samples);
179
+        src_short_to_float_array ((short *) b, converterData.data_in, samples);
180
         converterData.input_frames   = nSamples;
181
         converterData.data_out = resampledOffset + (resampledOffsetSize * channels);
182
         int srcError = src_process (converter, &converterData);
183
@@ -224,7 +167,6 @@
184
         int         inCount  = nSamples;
185
         short int     * shortBuffer  = new short int[samples];
186
         int         outCount = (int) (inCount * resampleRatio);
187
-        unsigned char * b = (unsigned char*) buf;
188
         Util::conv( bitsPerSample, b, processed, shortBuffer, isInBigEndian());
189
         converted = converter->resample( inCount,
190
                                          outCount+1,
191
@@ -235,18 +177,27 @@
192
         resampledOffsetSize += converted;
193
194
         // encode samples (if enough)
195
-        while(resampledOffsetSize - processedSamples >= inSamples/channels) {
196
+        while(resampledOffsetSize - processedSamples >= inputSamples/channels) {
197
+            int outputBytes;
198
 #ifdef HAVE_SRC_LIB
199
-            short *shortData = new short[inSamples];
200
+            short *shortData = new short[inputSamples];
201
             src_float_to_short_array(resampledOffset + (processedSamples * channels),
202
-                                     shortData, inSamples) ;
203
-
204
-            encodeAacSamples (shortData, inSamples, channels);
205
+                                     shortData, inputSamples) ;
206
+            outputBytes = aacplusEncEncode(encoderHandle,
207
+                                       (int32_t*) shortData,
208
+                                        inputSamples,
209
+                                        aacplusBuf,
210
+                                        maxOutputBytes);
211
             delete [] shortData;
212
 #else
213
-            encodeAacSamples (&resampledOffset[processedSamples*channels], inSamples, channels);
214
+            outputBytes = aacplusEncEncode(encoderHandle,
215
+                                       (int32_t*) &resampledOffset[processedSamples*channels],
216
+                                        inputSamples,
217
+                                        aacplusBuf,
218
+                                        maxOutputBytes);
219
 #endif
220
-            processedSamples+=inSamples/channels;
221
+            getSink()->write(aacplusBuf, outputBytes);
222
+            processedSamples+=inputSamples/channels;
223
         }
224
225
         if (processedSamples && (int) resampledOffsetSize >= processedSamples) {
226
@@ -262,70 +213,27 @@
227
 #endif
228
         }
229
     } else {
230
-        encodeAacSamples ((short *) buf, samples, channels);
231
-    }
232
+        while (processedSamples < samples) {
233
+            int     outputBytes;
234
+            int     inSamples = samples - processedSamples < (int) inputSamples
235
+                              ? samples - processedSamples
236
+                              : inputSamples;
237
+
238
+            outputBytes = aacplusEncEncode(encoderHandle,
239
+                                       (int32_t*) (b + processedSamples/sampleSize),
240
+                                        inSamples,
241
+                                        aacplusBuf,
242
+                                        maxOutputBytes);
243
+            getSink()->write(aacplusBuf, outputBytes);
244
245
-    return samples;
246
-}
247
-
248
-void
249
-aacPlusEncoder :: encodeAacSamples (short *TimeDataPcm, unsigned int samples, int channels)
250
-                                                                               throw ( Exception )
251
-{
252
-    unsigned int i;
253
-    int ch, outSamples, numOutBytes;
254
-
255
-    for (i=0; i<samples; i++)
256
-        inBuf[(2/channels)*i+writeOffset+writtenSamples] = (float) TimeDataPcm[i];
257
-
258
-    writtenSamples+=samples;
259
-
260
-    if (writtenSamples < inSamples)
261
-        return;
262
-
263
-    /* encode one SBR frame */
264
-    EnvEncodeFrame( hEnvEnc,
265
-                    inBuf + envReadOffset,
266
-                    inBuf + coreWriteOffset,
267
-                    MAX_CHANNELS,
268
-                    &numAncDataBytes,
269
-                    ancDataBytes);
270
-
271
-    /* 2:1 downsampling for AAC core */
272
-    if (!useParametricStereo) {
273
-        for( ch=0; ch<nChannelsAAC; ch++ )
274
-            IIR21_Downsample( &(IIR21_reSampler[ch]),
275
-                              inBuf + writeOffset+ch,
276
-                              writtenSamples/channels,
277
-                              MAX_CHANNELS,
278
-                              inBuf+ch,
279
-                              &outSamples,
280
-                              MAX_CHANNELS);
281
-    }
282
-
283
-    /* encode one AAC frame */
284
-    AacEncEncode( aacEnc,
285
-                  inBuf,
286
-                  useParametricStereo ? 1 : MAX_CHANNELS, /* stride (step) */
287
-                  ancDataBytes,
288
-                  &numAncDataBytes,
289
-                  (unsigned *) (outBuf+ADTS_HEADER_SIZE),
290
-                  &numOutBytes);
291
-    if (useParametricStereo) {
292
-        memcpy( inBuf,inBuf+AACENC_BLOCKSIZE,CORE_INPUT_OFFSET_PS*sizeof(float));
293
-    } else {
294
-        memmove( inBuf,inBuf+AACENC_BLOCKSIZE*2*MAX_CHANNELS,writeOffset*sizeof(float));
295
-    }
296
-
297
-    /* Write one frame of encoded audio */
298
-    if (numOutBytes) {
299
-        adts_hdr_up(outBuf, numOutBytes);
300
-        sink->write(outBuf, numOutBytes+ADTS_HEADER_SIZE);
301
+            processedSamples += inSamples;
302
+        }
303
     }
304
-
305
-    writtenSamples=0;
306
307
-    return;
308
+    delete[] aacplusBuf;
309
+
310
+//    return processedSamples;
311
+    return samples;
312
 }
313
314
 /*------------------------------------------------------------------------------
315
@@ -352,12 +260,7 @@
316
     if ( isOpen() ) {
317
         flush();
318
319
-        destroy_plans();
320
-        AacEncClose(aacEnc);
321
-        if (hEnvEnc) {
322
-            EnvClose(hEnvEnc);
323
-        }
324
-
325
+        aacplusEncClose(encoderHandle);
326
         aacplusOpen = false;
327
328
         sink->close();
(-)audio/darkice/files/patch-src_aacPlusEncoder.h (+194 lines)
Line 0 Link Here
1
--- src/aacPlusEncoder.h.orig	2010-05-10 07:18:48.000000000 +0900
2
+++ src/aacPlusEncoder.h	2010-10-13 07:42:25.000000000 +0900
3
@@ -5,8 +5,8 @@
4
    Tyrell DarkIce
5
6
    File     : aacPlusEncoder.h
7
-   Version  : $Revision: 474 $
8
-   Author   : $Author: rafael@riseup.net $
9
+   Version  : $Revision$
10
+   Author   : $Author$
11
    Location : $HeadURL$
12
13
    Copyright notice:
14
@@ -41,18 +41,7 @@
15
 #endif
16
17
 #ifdef HAVE_AACPLUS_LIB
18
-extern "C" {
19
-#include <libaacplus/cfftn.h>
20
-#include <libaacplus/FloatFR.h>
21
-#include <libaacplus/aacenc.h>
22
-#include <libaacplus/resampler.h>
23
-
24
-#include <libaacplus/adts.h>
25
-
26
-#include <libaacplus/sbr_main.h>
27
-#include <libaacplus/aac_ram.h>
28
-#include <libaacplus/aac_rom.h>
29
-}
30
+#include <aacplus.h>
31
 #else
32
 #error configure with aacplus
33
 #endif
34
@@ -83,16 +72,10 @@
35
 /**
36
  *  A class representing aacplus AAC+ encoder.
37
  *
38
- *  @author  $Author: rafael@riseup.net $
39
- *  @version $Revision: 474 $
40
+ *  @author  $Author$
41
+ *  @version $Revision$
42
  */
43
44
-#define CORE_DELAY   (1600)
45
-#define INPUT_DELAY  ((CORE_DELAY)*2 +6*64-2048+1)     /* ((1600 (core codec)*2 (multi rate) + 6*64 (sbr dec delay) - 2048 (sbr enc delay) + magic*/
46
-#define MAX_DS_FILTER_DELAY 16                         /* the additional max resampler filter delay (source fs)*/
47
-
48
-#define CORE_INPUT_OFFSET_PS (0)  /* (96-64) makes AAC still some 64 core samples too early wrt SBR ... maybe -32 would be even more correct, but 1024-32 would need additional SBR bitstream delay by one frame */
49
-
50
 class aacPlusEncoder : public AudioEncoder, public virtual Reporter
51
 {
52
     private:
53
@@ -124,31 +107,26 @@
54
          */
55
         Ref<Sink>                   sink;
56
57
-		float inBuf[(AACENC_BLOCKSIZE*2 + MAX_DS_FILTER_DELAY + INPUT_DELAY)*MAX_CHANNELS];
58
-		char outBuf[(6144/8)*MAX_CHANNELS+ADTS_HEADER_SIZE];
59
-		IIR21_RESAMPLER IIR21_reSampler[MAX_CHANNELS];
60
-
61
-		AACENC_CONFIG     config;
62
-		
63
-		int nChannelsAAC, nChannelsSBR;
64
-		unsigned int sampleRateAAC;
65
-
66
-		int bitrate;
67
-		int bandwidth;
68
-		
69
-		unsigned int numAncDataBytes;
70
-		unsigned char ancDataBytes[MAX_PAYLOAD_SIZE];
71
-		
72
-		bool useParametricStereo;
73
-		int coreWriteOffset;
74
-		int envReadOffset;
75
-		int writeOffset;
76
-		struct AAC_ENCODER *aacEnc;
77
-		unsigned int inSamples;
78
-		unsigned int writtenSamples;
79
-		
80
-		HANDLE_SBR_ENCODER hEnvEnc;
81
-		sbrConfiguration sbrConfig;
82
+        /**
83
+         *  The handle to the AAC+ encoder instance.
84
+         */
85
+        aacplusEncHandle               encoderHandle;
86
+
87
+        /**
88
+         *  The maximum number of input samples to supply to the encoder.
89
+         */
90
+        unsigned long               inputSamples;
91
+
92
+        /**
93
+         *  The maximum number of output bytes the encoder returns in one call.
94
+         */
95
+        unsigned long               maxOutputBytes;
96
+
97
+        /**
98
+         *  Lowpass filter. Sound frequency in Hz, from where up the
99
+         *  input is cut.
100
+         */
101
+        int                             lowpass;
102
103
         /**
104
          *  Initialize the object.
105
@@ -157,10 +135,11 @@
106
          *  @exception Exception
107
          */
108
         inline void
109
-        init ( Sink           * sink)                throw (Exception)
110
+        init ( Sink           * sink, int lowpass)                throw (Exception)
111
         {
112
             this->aacplusOpen        = false;
113
             this->sink            = sink;
114
+            this->lowpass         = lowpass;
115
 	
116
 	    /* TODO: if we have float as input, we don't need conversion */
117
             if ( getInBitsPerSample() != 16 && getInBitsPerSample() != 32 ) {
118
@@ -179,11 +158,6 @@
119
                         "unsupported number of output channels for the encoder",
120
                                  getOutChannel() );
121
             }
122
-	    /* TODO: this will be neede when we implement mono aac+ encoding */
123
-            if ( getInChannel() != getOutChannel() ) {
124
-                throw Exception( __FILE__, __LINE__,
125
-                             "input channels and output channels do not match");
126
-            }
127
128
             if ( getOutSampleRate() == getInSampleRate() ) {
129
                 resampleRatio = 1;
130
@@ -237,17 +211,6 @@
131
                                  "specified bits per sample with samplerate conversion not supported",
132
                                  getInBitsPerSample() );
133
             }
134
-
135
-            bitrate = getOutBitrate() * 1000;
136
-            bandwidth = 0;
137
-            useParametricStereo = 0;
138
-            numAncDataBytes=0;
139
-            coreWriteOffset = 0;
140
-            envReadOffset = 0;
141
-            writeOffset = INPUT_DELAY*MAX_CHANNELS;
142
-            writtenSamples = 0;
143
-            aacEnc = NULL;
144
-            hEnvEnc=NULL;
145
         }
146
147
         /**
148
@@ -269,10 +232,6 @@
149
             }
150
         }
151
152
-        void
153
-        encodeAacSamples (short *TimeDataPcm, unsigned int samples, int channels)
154
-                                                        throw ( Exception );
155
-
156
     protected:
157
158
         /**
159
@@ -335,7 +294,7 @@
160
                                      outSampleRate,
161
                                      outChannel )
162
         {
163
-            init( sink);
164
+            init( sink, lowpass);
165
         }
166
167
         /**
168
@@ -376,7 +335,7 @@
169
                                      outSampleRate,
170
                                      outChannel )
171
         {
172
-            init( sink);
173
+            init( sink, lowpass );
174
         }
175
176
         /**
177
@@ -389,7 +348,7 @@
178
                                                             throw ( Exception )
179
                     : AudioEncoder( encoder )
180
         {
181
-            init( encoder.sink.get());
182
+            init( encoder.sink.get(), encoder.lowpass);
183
         }
184
185
186
@@ -420,7 +379,7 @@
187
             if ( this != &encoder ) {
188
                 strip();
189
                 AudioEncoder::operator=( encoder);
190
-                init( encoder.sink.get());
191
+                init( encoder.sink.get(), encoder.lowpass);
192
             }
193
194
             return *this;

Return to bug 153519