bufferpool: Use TAG_MEMORY to check memory before releasing
authorWim Taymans <wtaymans@redhat.com>
Thu, 27 Feb 2014 14:14:59 +0000 (15:14 +0100)
committerWim Taymans <wtaymans@redhat.com>
Thu, 27 Feb 2014 14:43:13 +0000 (15:43 +0100)
commitf22d8f08e0a52c6f23520d67fba6b7e1aae61e6e
treeff4d1bf2ac72d9a208b985ad61d52ded4daeff36
parent5bca002f4bcb37e3c5453c77a750bb741e3cfea1
bufferpool: Use TAG_MEMORY to check memory before releasing

Tag allocated buffers with TAG_MEMORY. When they are released later,
only add them back to the pool if the tag is still there and the memory
has not been changed, otherwise throw the buffer away.
Add unit test to check various scenarios.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724481
gst/gstbufferpool.c
gst/gstbufferpool.h
tests/check/gst/gstbufferpool.c