From cd3c8cdebc13c132e0ae0117a1fc84775532ccb3 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 18 Feb 2016 03:03:08 +0100 Subject: Properly initialise toolame encoder --- libtoolame-dab/toolame.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libtoolame-dab') 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); -- cgit v1.2.3