mirror of
https://github.com/xiph/opus.git
synced 2025-06-03 00:57:43 +00:00
Fix stereo support; correctly deallocate bits_stereo.
This commit is contained in:
parent
60d0837ea0
commit
b6a3b0c464
2 changed files with 30 additions and 7 deletions
|
@ -394,7 +394,6 @@ CELTMode *celt_mode_create(celt_int32_t Fs, int channels, int frame_size, int *e
|
|||
if (mode->nbChannels>=2)
|
||||
mode->bits_stereo = (const celt_int16_t **)compute_alloc_cache(mode, mode->nbChannels);
|
||||
|
||||
mode->bits_stereo = NULL;
|
||||
#ifndef SHORTCUTS
|
||||
psydecay_init(&mode->psy, MAX_PERIOD/2, mode->Fs);
|
||||
#endif
|
||||
|
@ -430,6 +429,18 @@ void celt_mode_destroy(CELTMode *mode)
|
|||
}
|
||||
}
|
||||
celt_free((int**)mode->bits);
|
||||
if (mode->bits_stereo != NULL)
|
||||
{
|
||||
for (i=0;i<mode->nbEBands;i++)
|
||||
{
|
||||
if (mode->bits_stereo[i] != prevPtr)
|
||||
{
|
||||
prevPtr = mode->bits_stereo[i];
|
||||
celt_free((int*)mode->bits_stereo[i]);
|
||||
}
|
||||
}
|
||||
celt_free((int**)mode->bits_stereo);
|
||||
}
|
||||
if (check_mode(mode) != CELT_OK)
|
||||
return;
|
||||
celt_free((int*)mode->eBands);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue