always re-allocate aac codec between tracks - release

This commit is contained in:
Philippe G
2020-05-15 20:50:36 -07:00
parent c33635f35c
commit e04708ad1c
2 changed files with 7 additions and 3 deletions

Binary file not shown.

View File

@@ -576,9 +576,11 @@ static void helixaac_open(u8_t size, u8_t rate, u8_t chan, u8_t endianness) {
if (a->chunkinfo) {
free(a->chunkinfo);
}
if (a->stsc) {
free(a->stsc);
}
a->chunkinfo = NULL;
a->stsc = NULL;
a->skip = 0;
@@ -587,12 +589,14 @@ static void helixaac_open(u8_t size, u8_t rate, u8_t chan, u8_t endianness) {
a->empty = false;
if (a->hAac) {
HAAC(a, FlushCodec, a->hAac);
// always free decoder as flush only works when no parameter has changed
HAAC(a, FreeDecoder, a->hAac);
} else {
a->hAac = HAAC(a, InitDecoder);
a->write_buf = malloc(FRAME_BUF * BYTES_PER_FRAME);
a->wrap_buf = malloc(WRAPBUF_LEN);
}
a->hAac = HAAC(a, InitDecoder);
}
static void helixaac_close(void) {