Skip to content
Snippets Groups Projects
Verified Commit fb903589 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Improve silence handling

Copy the previous analysis data instead of flagging as invalid
parent 8fe25871
No related branches found
No related tags found
No related merge requests found
......@@ -547,7 +547,11 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
tonal->mem_fill = 240 + remaining;
if (is_silence)
{
info->valid = 0;
/* On silence, copy the previous analysis. */
int prev_pos = tonal->write_pos-=2;
if (prev_pos < 0)
prev_pos += DETECT_SIZE;
OPUS_COPY(info, &tonal->info[prev_pos], 1);
RESTORE_STACK;
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment