aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);