voamrwbenc: Fix truncation of audio data at end-of-stream when audio data
authorDevin Anderson <danderson@microsoft.com>
Thu, 15 Sep 2022 00:52:14 +0000 (00:52 +0000)
committerDevin Anderson <danderson@microsoft.com>
Fri, 16 Sep 2022 00:14:58 +0000 (00:14 +0000)
commit31831eb47e04ee825d2be7f474db584f3f5063bb
treed30bb24517fe24e8a2d3e117a7045561cd595c08
parent4db55bc759f8a71c8d3901eb1fb35f3c34ddb4a3
voamrwbenc: Fix truncation of audio data at end-of-stream when audio data
doesn't align on 20 millisecond frame size.

The AMR-WB codec imposes a fixed 20 millisecond frame size.  In its current
form, the `voamrwbenc` plugin deals with this limitation by discarding any
audio at the end of the stream that falls short of 20 milliseconds.  This patch
keeps the audio data, and appends silence to the end to preserve frame size
alignment.

The patch also adds tests to check for the updated behavior.  I noticed that
tests weren't being built, so I changed the build to allow for building the
tests when the `tests` and `voamrwbenc` options are set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3027>
subprojects/gst-plugins-bad/ext/voamrwbenc/gstvoamrwbenc.c
subprojects/gst-plugins-bad/tests/check/elements/voamrwbenc.c
subprojects/gst-plugins-bad/tests/check/meson.build