summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-06-02 21:18:55 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-06-02 21:18:55 +0200
commit81b757b95ab603b7368e19f4140661d799c9449f (patch)
treee1cda664fd870860c20cca457d28d1d099e547cf /src
parentc4b00bc2b2763fe32874e5893daf940ffb7f4434 (diff)
downloadfdk-aac-dabplus-81b757b95ab603b7368e19f4140661d799c9449f.tar.gz
fdk-aac-dabplus-81b757b95ab603b7368e19f4140661d799c9449f.tar.bz2
fdk-aac-dabplus-81b757b95ab603b7368e19f4140661d799c9449f.zip
Correct handling of AOT definition
Diffstat (limited to 'src')
-rw-r--r--src/dabplus-enc.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp
index a02444f..c409acb 100644
--- a/src/dabplus-enc.cpp
+++ b/src/dabplus-enc.cpp
@@ -143,6 +143,9 @@ int prepare_aac_encoder(
else if((channels == 1 && subchannel_index <= 8) || subchannel_index <= 10) {
*aot = AOT_DABPLUS_SBR;
}
+ else {
+ *aot = AOT_DABPLUS_AAC_LC;
+ }
}
fprintf(stderr, "Using %d subchannels. AAC type: %s%s%s. channels=%d, sample_rate=%d\n",
@@ -356,14 +359,6 @@ int main(int argc, char *argv[])
return 1;
}
- /* We assume that we need to call the encoder
- * enc_calls_per_output before it gives us one encoded audio
- * frame. This information is used when the alsa drift compensation
- * is active
- */
- const int enc_calls_per_output =
- (aot == AOT_DABPLUS_AAC_LC) ? sample_rate / 8000 : sample_rate / 16000;
-
zmq::context_t zmq_ctx;
zmq::socket_t zmq_sock(zmq_ctx, ZMQ_PUB);
@@ -435,6 +430,15 @@ int main(int argc, char *argv[])
return 2;
}
+ /* We assume that we need to call the encoder
+ * enc_calls_per_output before it gives us one encoded audio
+ * frame. This information is used when the alsa drift compensation
+ * is active
+ */
+ const int enc_calls_per_output =
+ (aot == AOT_DABPLUS_AAC_LC) ? sample_rate / 8000 : sample_rate / 16000;
+
+
if (aacEncInfo(encoder, &info) != AACENC_OK) {
fprintf(stderr, "Unable to get the encoder info\n");
return 1;
@@ -670,9 +674,10 @@ int main(int argc, char *argv[])
{
// Our timing code depends on this
if (calls != enc_calls_per_output) {
- fprintf(stderr, "INTERNAL ERROR! sample rate %d, calls %d\n",
- sample_rate, calls);
- }
+ fprintf(stderr, "INTERNAL ERROR! calls=%d"
+ ", expected %d\n",
+ calls, enc_calls_per_output);
+ }
calls = 0;
// ----------- RS encoding