opusdec: Fix PLC frame size calculations
authorCarlos Rafael Giani <dv@pseudoterminal.org>
Mon, 20 Apr 2015 13:04:56 +0000 (15:04 +0200)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Mon, 20 Jul 2015 17:25:43 +0000 (13:25 -0400)
commite5409361b8c18442d103dbef3ad3c0afa3b781f0
treef1cb893d23877895f91385df170f2fd9311dde67
parentde5500b6a9b1d771fea440c6a238e19c495e38fb
opusdec: Fix PLC frame size calculations

Previously, PLC frames always had a length of 120ms, which caused audio
quality degradation and synchronization errors. Fix this by calculating an
appropriate length for the PLC frame.

The length must be a multiple of 2.5ms. Calculate a multiple of 2.5ms that
is nearest to the current PLC length. Any leftover PLC length that didn't
make it into this frame is accumulated for the next PLC frame.

https://bugzilla.gnome.org/show_bug.cgi?id=725167
ext/opus/gstopusdec.c
ext/opus/gstopusdec.h