bufferpool: Fix the buffer size reset code
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Sat, 29 Jun 2019 13:22:05 +0000 (09:22 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 1 Jul 2019 20:49:04 +0000 (16:49 -0400)
commit8a9b20a18b76bf9004f2f8004b4293e1ac7a48aa
tree2e6721b5a9227e5aaf2dc68e05a6b700404c3d92
parent3e2f24955eedfe0a04a8d2246552116121b24517
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