JBM issue in format switching

This is a follow up to !2546 (merged).

There is likely a bug in the format switching at the decoder in the JBM logic. In the current implementation, it seems that packets still present in the jitter buffer are ignored (not decoded) and zeroed audio is written out for several continuous frames. With the bitstream from #1525 (closed), the number of zeroed frames is 4 but I vaguely remember that I saw up to 8 frames in the past. I am thus wondering whether the VoIP logic is correct and the packets decoding should not be continuous... Either the jitter buffer should probably be unloaded first before switching the format, or the jitter buffer should work continuously.

I quickly tried a fix which consists of keeping high-level handles like hIvasDec, hIvasDec->st_ivas, hIvasDec->st_ivas->hDecoderConfig, and hIvasDec->hVoIP during the format switching allocated. Using the bitstream attached to #1525 (closed), the impact is shown below (up=baseline, down=fix):

image.png

Thus, the discontinuity during the format switching is significantly shorter.

I put my experimental fix at 1db032e4 for possible replication. Note that the fix is not tested except for the mentioned bitstream and is rather an inspiration of what can be done to smooth the format switching decoding.

Edited Mar 13, 2026 by vaclav
Assignee Loading
Time tracking Loading