appsink: fix end condition of query drain handler
authorJulien Isorce <jisorce@oblong.com>
Wed, 29 Nov 2017 14:53:57 +0000 (14:53 +0000)
committerJulien Isorce <jisorce@oblong.com>
Wed, 29 Nov 2017 15:09:04 +0000 (15:09 +0000)
commit8af7b1f70b554ec25025a8c08c9f0dd14954923c
tree701bb00e219b2be527c11e2dc89171087967c82a
parent3300584e96217f52467fd570679dd2eb8788cd9f
appsink: fix end condition of query drain handler

The while loop should end when all buffers "and" the preroll
buffer are consumed but this means to continue waiting if there
are still some pending buffers "or" preroll buffer.

The unit test was correct but racy because of this mistake.
I.e. because of the wrong "and" the while could finish too early.

cd tests/check && GST_CHECKS=test_query_drain make elements/appsink.forever

https://bugzilla.gnome.org/show_bug.cgi?id=789763
gst-libs/gst/app/gstappsink.c