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)
commita595874aac5d8b7a5c628ef34d749d558c791d5f
tree960e0946b57398be28576bf94eefb2f06ceefb05
parentb4fe1b516be609c1998ded211764c874569a3422
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