aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-02-18 03:03:08 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-02-18 03:03:08 +0100
commitcd3c8cdebc13c132e0ae0117a1fc84775532ccb3 (patch)
treeb13142b956c05f592504c51c3903a6b1d69b9fd9
parent5448387d0d3adbb6b077f856084fff2a51badd98 (diff)
downloadfdk-aac-dabplus-cd3c8cdebc13c132e0ae0117a1fc84775532ccb3.tar.gz
fdk-aac-dabplus-cd3c8cdebc13c132e0ae0117a1fc84775532ccb3.tar.bz2
fdk-aac-dabplus-cd3c8cdebc13c132e0ae0117a1fc84775532ccb3.zip
Properly initialise toolame encoder
-rw-r--r--libtoolame-dab/toolame.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libtoolame-dab/toolame.c b/libtoolame-dab/toolame.c
index 9eed2f6..fd2c3c9 100644
--- a/libtoolame-dab/toolame.c
+++ b/libtoolame-dab/toolame.c
@@ -268,6 +268,9 @@ int toolame_set_pad(int pad_len)
return 0;
}
+
+static int encode_first_call = 1;
+
int toolame_encode_frame(
short buffer[2][1152],
unsigned char *xpad_data,
@@ -278,6 +281,11 @@ int toolame_encode_frame(
const int nch = frame.nch;
const int error_protection = header.error_protection;
+ if (encode_first_call) {
+ hdr_to_frps(&frame);
+ encode_first_call = 0;
+ }
+
bs.output_buffer = output_buffer;
bs.output_buffer_size = output_buffer_size;
bs.output_buffer_written = 0;
@@ -460,6 +468,10 @@ int toolame_encode_frame(
}
}
+ fprintf(stderr, "FRAME nch: %d sblimit %d\n",
+ frame.nch,
+ frame.sblimit);
+
#ifdef NEWENCODE
sf_transmission_pattern (scalar, scfsi, &frame);
main_bit_allocation_new (smr, scfsi, bit_alloc, &adb, &frame, &glopts);