bufferpool: Fix the buffer size reset code
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Sat, 29 Jun 2019 13:22:05 +0000 (09:22 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 8 Aug 2019 17:49:40 +0000 (18:49 +0100)
commit53bf06c08814ff9ac3968d47daf11a395cf26a01
tree226e83c1bd30d5e0169e105a455485c6cc0a8fcb
parent84707d088f921d5f09f7533e02f8ef53e031fc4d
bufferpool: Fix the buffer size reset code

The offset in gst_buffer_resize() is additive. So to move back the
offset to zero, we need to pass the opposite of the current offset. This
was raised through the related unit test failingon 32bit as on 64bit
the alignment padding was enough to hide the issue. The test was
modified to also fail on 64bit. This patch will remove spurious
assertions like:

  assertion 'bufmax >= bufoffs + offset + size' failed

Fixes #316
gst/gstbufferpool.c
tests/check/gst/gstbufferpool.c