Doing a best for "unprotected" switches to 2.5 ms frames
This commit is contained in:
parent
e2f1aac572
commit
eb17b5e00e
1 changed files with 17 additions and 6 deletions
|
@ -450,13 +450,24 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
|
||||||
pcm+st->channels*F2_5, F2_5, st->channels, window, st->Fs);
|
pcm+st->channels*F2_5, F2_5, st->channels, window, st->Fs);
|
||||||
}
|
}
|
||||||
if (transition)
|
if (transition)
|
||||||
|
{
|
||||||
|
if (audiosize >= F5)
|
||||||
{
|
{
|
||||||
for (i=0;i<st->channels*F2_5;i++)
|
for (i=0;i<st->channels*F2_5;i++)
|
||||||
pcm[i] = pcm_transition[i];
|
pcm[i] = pcm_transition[i];
|
||||||
if (audiosize >= F5)
|
|
||||||
smooth_fade(pcm_transition+st->channels*F2_5, pcm+st->channels*F2_5,
|
smooth_fade(pcm_transition+st->channels*F2_5, pcm+st->channels*F2_5,
|
||||||
pcm+st->channels*F2_5, F2_5,
|
pcm+st->channels*F2_5, F2_5,
|
||||||
st->channels, window, st->Fs);
|
st->channels, window, st->Fs);
|
||||||
|
} else {
|
||||||
|
/* Not enough time to do a clean transition, but we do it anyway
|
||||||
|
This will not preserve amplitude perfectly and may introduce
|
||||||
|
a bit of temporal aliasing, but it shouldn't be too bad and
|
||||||
|
that's pretty much the best we can do. In any case, generating this
|
||||||
|
transition it pretty silly in the first place */
|
||||||
|
smooth_fade(pcm_transition, pcm,
|
||||||
|
pcm, F2_5,
|
||||||
|
st->channels, window, st->Fs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len <= 1)
|
if (len <= 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue